From c966a96efb7f305b75edfecfb3218d0c835abc1a Mon Sep 17 00:00:00 2001 From: yangyan Date: Fri, 10 May 2019 17:56:31 +0800 Subject: Add ARG and PKG_VERSION to Dockerfile Change-Id: I4fad5e67c6e0cfe96bd28016367b378b3da66796 Issue-ID: VFC-1383 Signed-off-by: yangyan --- res/docker/Dockerfile | 3 +++ res/docker/build_image.sh | 2 ++ res/docker/docker-env-conf.sh | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'res') diff --git a/res/docker/Dockerfile b/res/docker/Dockerfile index 79e4f83..b9f995e 100644 --- a/res/docker/Dockerfile +++ b/res/docker/Dockerfile @@ -2,8 +2,11 @@ FROM python:2-alpine ARG HTTP_PROXY=${HTTP_PROXY} ARG HTTPS_PROXY=${HTTPS_PROXY} +ARG PKG_VERSION ENV http_proxy $HTTP_PROXY ENV https_proxy $HTTPS_PROXY +ENV pkg_verison=${PKG_VERSION} + ADD . /service WORKDIR /service diff --git a/res/docker/build_image.sh b/res/docker/build_image.sh index f8212ff..1025362 100755 --- a/res/docker/build_image.sh +++ b/res/docker/build_image.sh @@ -13,6 +13,8 @@ DOCKER_REPOSITORY="nexus3.onap.org:10003" IMAGE_NAME="${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/${IMAGE}" TIMESTAMP=$(date +"%Y%m%dT%H%M%S") +BUILD_ARGS+=" --build-arg PKG_VERSION=${VERSION}" + if [ $HTTP_PROXY ]; then BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}" fi diff --git a/res/docker/docker-env-conf.sh b/res/docker/docker-env-conf.sh index 57c505e..5848339 100755 --- a/res/docker/docker-env-conf.sh +++ b/res/docker/docker-env-conf.sh @@ -7,8 +7,8 @@ install_sf(){ apk --no-cache add python-dev libffi-dev musl-dev py2-virtualenv # get binary zip from nexus - wget -q -O vfc-gvnfm-vnfres.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.gvnfm.vnfres.res&a=vfc-gvnfm-vnfres-res&v=LATEST&e=zip' - unzip vfc-gvnfm-vnfres.zip + wget -q -O vfc-gvnfm-vnfres.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.gvnfm.vnfres.res&a=vfc-gvnfm-vnfres-res&v=${pkg_verison}-SNAPSHOT&e=zip' && \ + unzip vfc-gvnfm-vnfres.zip && \ rm -rf vfc-gvnfm-vnfres.zip wait pip install --upgrade setuptools pip -- cgit 1.2.3-korg