From 2e6d739fc82969f1d96a4e722dc973264e66e8fd Mon Sep 17 00:00:00 2001 From: Chris Crone Date: Tue, 22 Sep 2020 13:32:06 +0200 Subject: [PATCH] scripts: Add test for CentOS Signed-off-by: Chris Crone --- scripts/install/test.Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/install/test.Dockerfile b/scripts/install/test.Dockerfile index ba844ee8..10d1fedc 100644 --- a/scripts/install/test.Dockerfile +++ b/scripts/install/test.Dockerfile @@ -12,19 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM ubuntu:20.04 AS base +# Distro options: ubuntu, centos +ARG DISTRO=ubuntu + +FROM ubuntu:20.04 AS base-ubuntu RUN apt-get update && apt-get install -y \ curl RUN curl https://get.docker.com | sh -FROM base AS install +FROM centos:7 AS base-centos +RUN curl https://get.docker.com | sh + +FROM base-${DISTRO} AS install COPY install_linux.sh /scripts/install_linux.sh RUN chmod +x /scripts/install_linux.sh ARG DOWNLOAD_URL= RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh RUN docker version | grep Cloud -# check we can update FROM install AS upgrade RUN DOWNLOAD_URL=${DOWNLOAD_URL} /scripts/install_linux.sh RUN docker version | grep Cloud @@ -33,3 +38,5 @@ RUN docker version | grep Cloud # then run a docker build passing the DOWNLOAD_URL as a build arg: # $ cd dist/ && python3 -m http.server & # $ docker build -f test.Dockerfile --build-arg DOWNLOAD_URL=http://192.168.0.22:8000/docker-linux-amd64.tar.gz . +# +# You can specify centos or ubuntu as distros using the DISTRO build arg.