diff options
author | 2019-05-10 17:51:43 +0800 | |
---|---|---|
committer | 2019-05-10 17:51:54 +0800 | |
commit | cb5654fe263079ed7ffb908620fd7cfde3a74e58 (patch) | |
tree | f9290647cf7ca42fadc1e0bffe98ae4d91c16f57 | |
parent | fa6078ef73eb4838ab9dee1fba8e7b1fbf3c9131 (diff) |
Add ARG and PKG_VERSION to Dockerfile
Change-Id: Id88d20078a21094c5f5c2167d1b8ec8c95e46592
Issue-ID: VFC-1383
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rw-r--r-- | mgr/docker/Dockerfile | 3 | ||||
-rwxr-xr-x | mgr/docker/build_image.sh | 2 | ||||
-rwxr-xr-x | mgr/docker/docker-env-conf.sh | 4 |
3 files changed, 7 insertions, 2 deletions
diff --git a/mgr/docker/Dockerfile b/mgr/docker/Dockerfile index b12a873..fa69214 100644 --- a/mgr/docker/Dockerfile +++ b/mgr/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/mgr/docker/build_image.sh b/mgr/docker/build_image.sh index f51e90d..1bbc2d0 100755 --- a/mgr/docker/build_image.sh +++ b/mgr/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/mgr/docker/docker-env-conf.sh b/mgr/docker/docker-env-conf.sh index 40abe38..ff0b55e 100755 --- a/mgr/docker/docker-env-conf.sh +++ b/mgr/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-vnfmgr.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.gvnfm.vnfmgr.mgr&a=vfc-gvnfm-vnfmgr-mgr&v=LATEST&e=zip' - unzip vfc-gvnfm-vnfmgr.zip + wget -q -O vfc-gvnfm-vnfmgr.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.gvnfm.vnfmgr.mgr&a=vfc-gvnfm-vnfmgr-mgr&v=${pkg_verison}-SNAPSHOT&e=zip' && \ + unzip vfc-gvnfm-vnfmgr.zip && \ rm -rf vfc-gvnfm-vnfmgr.zip wait pip install --upgrade setuptools pip |