From bcf04b1a6cd4ef2a382319a5e31adbda4c6666be Mon Sep 17 00:00:00 2001 From: Soam Vasani Date: Thu, 9 Nov 2017 14:01:02 -0800 Subject: [PATCH] Build both python 3.5 and 2.7 images from the same env --- environments/{python3 => python}/Dockerfile | 0 environments/python/Dockerfile-2.7 | 14 ++++++++++++++ environments/{python3 => python}/README.md | 0 .../{python3 => python}/builder/Dockerfile | 0 .../builder/defaultBuildCmd | 0 .../{python3 => python}/requirements.txt | 0 environments/{python3 => python}/server.py | 0 hack/release.sh | 19 ++++++++++--------- test/build_and_test.sh | 2 +- 9 files changed, 25 insertions(+), 10 deletions(-) rename environments/{python3 => python}/Dockerfile (100%) create mode 100644 environments/python/Dockerfile-2.7 rename environments/{python3 => python}/README.md (100%) rename environments/{python3 => python}/builder/Dockerfile (100%) rename environments/{python3 => python}/builder/defaultBuildCmd (100%) rename environments/{python3 => python}/requirements.txt (100%) rename environments/{python3 => python}/server.py (100%) diff --git a/environments/python3/Dockerfile b/environments/python/Dockerfile similarity index 100% rename from environments/python3/Dockerfile rename to environments/python/Dockerfile diff --git a/environments/python/Dockerfile-2.7 b/environments/python/Dockerfile-2.7 new file mode 100644 index 00000000..be9c736e --- /dev/null +++ b/environments/python/Dockerfile-2.7 @@ -0,0 +1,14 @@ +FROM alpine:3.5 + +RUN apk update +RUN apk add --no-cache python python-dev build-base py-pip +RUN pip install --upgrade pip +RUN rm -r /root/.cache + +COPY . /app +WORKDIR /app +RUN pip install -r requirements.txt + +ENTRYPOINT ["python"] +CMD ["server.py"] + diff --git a/environments/python3/README.md b/environments/python/README.md similarity index 100% rename from environments/python3/README.md rename to environments/python/README.md diff --git a/environments/python3/builder/Dockerfile b/environments/python/builder/Dockerfile similarity index 100% rename from environments/python3/builder/Dockerfile rename to environments/python/builder/Dockerfile diff --git a/environments/python3/builder/defaultBuildCmd b/environments/python/builder/defaultBuildCmd similarity index 100% rename from environments/python3/builder/defaultBuildCmd rename to environments/python/builder/defaultBuildCmd diff --git a/environments/python3/requirements.txt b/environments/python/requirements.txt similarity index 100% rename from environments/python3/requirements.txt rename to environments/python/requirements.txt diff --git a/environments/python3/server.py b/environments/python/server.py similarity index 100% rename from environments/python3/server.py rename to environments/python/server.py diff --git a/hack/release.sh b/hack/release.sh index 2c70b7d1..e23bdf68 100755 --- a/hack/release.sh +++ b/hack/release.sh @@ -128,16 +128,17 @@ build_and_push_all_envs() { version=$1 # call with version, env dir, image name base, image name variant - build_and_push_env_image "$version" "nodejs" "node-env" "" - build_and_push_env_image "$version" "nodejs" "node-env" "debian" - build_and_push_env_image "$version" "binary" "binary-env" "" - build_and_push_env_image "$version" "dotnet" "dotnet-env" "" + build_and_push_env_image "$version" "nodejs" "node-env" "" + build_and_push_env_image "$version" "nodejs" "node-env" "debian" + build_and_push_env_image "$version" "binary" "binary-env" "" + build_and_push_env_image "$version" "dotnet" "dotnet-env" "" build_and_push_env_image "$version" "dotnet20" "dotnet20-env" "" - build_and_push_env_image "$version" "go" "go-env" "" - build_and_push_env_image "$version" "perl" "perl-env" "" - build_and_push_env_image "$version" "php7" "php-env" "" - build_and_push_env_image "$version" "python3" "python-env" "" - build_and_push_env_image "$version" "ruby" "ruby-env" "" + build_and_push_env_image "$version" "go" "go-env" "" + build_and_push_env_image "$version" "perl" "perl-env" "" + build_and_push_env_image "$version" "php7" "php-env" "" + build_and_push_env_image "$version" "python" "python-env" "" + build_and_push_env_image "$version" "python" "python-env" "2.7" + build_and_push_env_image "$version" "ruby" "ruby-env" "" } build_charts() { diff --git a/test/build_and_test.sh b/test/build_and_test.sh index ff55f5cc..e0306f5d 100755 --- a/test/build_and_test.sh +++ b/test/build_and_test.sh @@ -21,7 +21,7 @@ build_and_push_fetcher $FETCHER_IMAGE:$TAG build_builder -ENV='python3' +ENV='python' build_and_push_env_runtime $ENV $REPO/$ENV-env:$TAG