Use 'git clone' instead of tarball for scripts

Refactor the Dockerfiles to clone the common scripts and checkout a
predefined tag, instead of requiring a tarball.

Change-Id: I99718c34a86b050c3e83110dc07584e7572fe906
This commit is contained in:
Paul Bourke 2017-04-04 17:10:41 +01:00
parent 6d3810e774
commit 2811781b89
3 changed files with 21 additions and 18 deletions

View File

@ -7,14 +7,15 @@ ARG WHEELS
ARG GIT_REPO=https://git.openstack.org/openstack/${PROJECT}
ARG GIT_REF
ARG GIT_REF_REPO=https://git.openstack.org/openstack/${PROJECT}
ARG SCRIPTS=https://github.com/yaodu/common/archive/0.1.2.tar.gz
ARG SCRIPTS_REF=0.1.2
ARG SCRIPTS_REPO=https://github.com/yaodu/common/
ARG OVERRIDE=empty
ADD $OVERRIDE /
RUN set -x \
&& yum install --setopt=tsflags=nodocs -y python curl \
&& curl -sSL $SCRIPTS | tar xz -C /tmp/ --strip-components=2 \
&& /tmp/download.sh $DOCKER_REPO $DOCKER_TAG $WHEELS \
&& /tmp/install.sh $PROJECT $GIT_REPO $GIT_REF_REPO $GIT_REF \
&& /tmp/cleanup.sh
&& yum install --setopt=tsflags=nodocs -y python curl git \
&& git clone --branch $SCRIPTS_REF --depth 1 $SCRIPTS_REPO /tmp/common \
&& /tmp/common/scripts/download.sh $DOCKER_REPO $DOCKER_TAG $WHEELS \
&& /tmp/common/scripts/install.sh $PROJECT $GIT_REPO $GIT_REF_REPO $GIT_REF \
&& /tmp/common/scripts/cleanup.sh

13
debian/Dockerfile vendored
View File

@ -7,15 +7,16 @@ ARG WHEELS
ARG GIT_REPO=https://git.openstack.org/openstack/${PROJECT}
ARG GIT_REF
ARG GIT_REF_REPO=https://git.openstack.org/openstack/${PROJECT}
ARG SCRIPTS=https://github.com/yaodu/common/archive/0.1.2.tar.gz
ARG SCRIPTS_REF=0.1.2
ARG SCRIPTS_REPO=https://github.com/yaodu/common/
ARG OVERRIDE=empty
ADD $OVERRIDE /
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends python ca-certificates curl \
&& curl -sSL $SCRIPTS | tar xz -C /tmp/ --strip-components=2 \
&& /tmp/download.sh $DOCKER_REPO $DOCKER_TAG $WHEELS \
&& /tmp/install.sh $PROJECT $GIT_REPO $GIT_REF_REPO $GIT_REF \
&& /tmp/cleanup.sh
&& apt-get install -y --no-install-recommends python ca-certificates curl git \
&& git clone --branch $SCRIPTS_REF --depth 1 $SCRIPTS_REPO /tmp/common \
&& /tmp/common/scripts/download.sh $DOCKER_REPO $DOCKER_TAG $WHEELS \
&& /tmp/common/scripts/install.sh $PROJECT $GIT_REPO $GIT_REF_REPO $GIT_REF \
&& /tmp/common/scripts/cleanup.sh

View File

@ -7,15 +7,16 @@ ARG WHEELS
ARG GIT_REPO=https://git.openstack.org/openstack/${PROJECT}
ARG GIT_REF
ARG GIT_REF_REPO=https://git.openstack.org/openstack/${PROJECT}
ARG SCRIPTS=https://github.com/yaodu/common/archive/0.1.2.tar.gz
ARG SCRIPTS_REF=0.1.2
ARG SCRIPTS_REPO=https://github.com/yaodu/common/
ARG OVERRIDE=empty
ADD $OVERRIDE /
RUN set -x \
&& apt-get update \
&& apt-get install -y --no-install-recommends python ca-certificates curl \
&& curl -sSL $SCRIPTS | tar xz -C /tmp/ --strip-components=2 \
&& /tmp/download.sh $DOCKER_REPO $DOCKER_TAG $WHEELS \
&& /tmp/install.sh $PROJECT $GIT_REPO $GIT_REF_REPO $GIT_REF \
&& /tmp/cleanup.sh
&& apt-get install -y --no-install-recommends python ca-certificates curl git \
&& git clone --branch $SCRIPTS_REF --depth 1 $SCRIPTS_REPO /tmp/common \
&& /tmp/common/scripts/download.sh $DOCKER_REPO $DOCKER_TAG $WHEELS \
&& /tmp/common/scripts/install.sh $PROJECT $GIT_REPO $GIT_REF_REPO $GIT_REF \
&& /tmp/common/scripts/cleanup.sh