summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorThiago da Silva <thiagodasilva@gmail.com>2019-08-19 22:31:41 +0200
committerThiago da Silva <thiagodasilva@gmail.com>2019-08-19 22:31:41 +0200
commit94366fd00ec1e71b4f67ef8595b31162c6945c28 (patch)
treece58b455a9d3d220b480dd116c198b1ec35632fa /docker
parent3e7752d8c80473e93d537c7ba30419ff9313ebb8 (diff)
downloadswift-94366fd00ec1e71b4f67ef8595b31162c6945c28.tar.gz
Add Dockerfile to build a py3 swift docker image
This patch contains only a new Dockerfile and few changes to be able to build both py2 and py3 images. Next patch should contain changes to add the gate jobs to build a py3 docker image Change-Id: Ifdebde9597a787abcd553756e22261e2faaeedfc
Diffstat (limited to 'docker')
-rwxr-xr-xdocker/install_scripts/10_apk_install_prereqs.sh3
-rwxr-xr-xdocker/install_scripts/15_install_python_and_pip_src.sh57
-rwxr-xr-xdocker/install_scripts/20_apk_install_py2.sh7
-rwxr-xr-xdocker/install_scripts/20_pip_install_prereqs.sh32
-rwxr-xr-xdocker/install_scripts/21_apk_install_py3.sh10
5 files changed, 17 insertions, 92 deletions
diff --git a/docker/install_scripts/10_apk_install_prereqs.sh b/docker/install_scripts/10_apk_install_prereqs.sh
index eedff185a..f021b4c11 100755
--- a/docker/install_scripts/10_apk_install_prereqs.sh
+++ b/docker/install_scripts/10_apk_install_prereqs.sh
@@ -25,6 +25,3 @@ apk add --update \
libxslt-dev \
libxml2 \
libxml2-dev \
- python \
- python-dev \
- py-pip
diff --git a/docker/install_scripts/15_install_python_and_pip_src.sh b/docker/install_scripts/15_install_python_and_pip_src.sh
deleted file mode 100755
index 294ec92f1..000000000
--- a/docker/install_scripts/15_install_python_and_pip_src.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/sh
-set -e
-
-echo
-echo
-echo
-echo "building python and pip"
-
-# export PATH=$PATH:/usr/include
-
-mkdir $BUILD_DIR/python27
-mkdir $BUILD_DIR/python36
-
-echo
-echo
-echo
-echo "building python 2.7.15"
-
-cd $BUILD_DIR/python27
-wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
-tar -zxvf Python-2.7.15.tgz
-cd Python-2.7.15
-./configure --enable-optimizations
-make
-make DESTDIR=/opt/python27 install
-
-echo
-echo
-echo
-echo "building python 3.6.5"
-
-cd $BUILD_DIR/python36
-wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
-tar -zxvf Python-3.6.5.tgz
-cd Python-3.6.5
-./configure --enable-optimizations
-make
-make DESTDIR=/opt/python36 install
-
-export PATH=$PATH:/opt/python27/usr/local/bin:/opt/python36/usr/local/bin
-echo "export PATH=$PATH:/opt/python27/usr/local/bin:/opt/python36/usr/local/bin" >> /etc/profile
-
-echo
-echo
-echo
-echo "building pip"
-wget https://bootstrap.pypa.io/get-pip.py
-python ./get-pip.py
-
-echo
-echo
-echo
-echo "deleting python internal test dirs"
-for f in `cat /opt/swift/docker/install_scripts/python_test_dirs` ; do rm -rf $f; done
-
-rm -rf $BUILD_DIR/python27
-rm -rf $BUILD_DIR/python36
diff --git a/docker/install_scripts/20_apk_install_py2.sh b/docker/install_scripts/20_apk_install_py2.sh
new file mode 100755
index 000000000..7f4790d97
--- /dev/null
+++ b/docker/install_scripts/20_apk_install_py2.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+set -e
+
+apk add --update \
+ python \
+ python-dev \
+ py-pip
diff --git a/docker/install_scripts/20_pip_install_prereqs.sh b/docker/install_scripts/20_pip_install_prereqs.sh
deleted file mode 100755
index d9cc9e6b4..000000000
--- a/docker/install_scripts/20_pip_install_prereqs.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/bin/sh
-set -e
-
-echo "+ + + + + + + + + + upgrading pip" && \
-pip install -U pip && \
-cd /opt/swift && \
-pip install -r requirements.txt
-
-#echo "+ + + + + + + + + + installing pastedeploy" && \
-#pip install pastedeploy && \
-#echo "+ + + + + + + + + + installing eventlet" && \
-#pip install eventlet && \
-#echo "+ + + + + + + + + + installing greenlet" && \
-#pip install greenlet && \
-#echo "+ + + + + + + + + + installing netifaces" && \
-#pip install netifaces && \
-#echo "+ + + + + + + + + + installing setuptools" && \
-#pip install setuptools && \
-#echo "+ + + + + + + + + + installing requests" && \
-#pip install requests && \
-#echo "+ + + + + + + + + + installing six" && \
-#pip install six && \
-#echo "+ + + + + + + + + + installing cryptography" && \
-#pip install cryptography && \
-#echo "+ + + + + + + + + + installing dnspython" && \
-#pip install dnspython
-#echo "+ + + + + + + + + + installing xattr" && \
-#pip install xattr
-#echo "+ + + + + + + + + + installing pyeclib" && \
-#pip install pyeclib
-#echo "+ + + + + + + + + + installing lxml" && \
-#pip install lxml
diff --git a/docker/install_scripts/21_apk_install_py3.sh b/docker/install_scripts/21_apk_install_py3.sh
new file mode 100755
index 000000000..a9f9b4b8c
--- /dev/null
+++ b/docker/install_scripts/21_apk_install_py3.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+apk add --update \
+ python3 \
+ python3-dev \
+ py3-pip
+
+if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
+