Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and correct python 2.x dockerfile #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 22 additions & 18 deletions Python/2.x/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,20 @@
# Base image
FROM s390x/ubuntu:16.04

ARG PYTHON_VER=2.7.15

# The author
MAINTAINER LoZ Open Source Ecosystem (https://www.ibm.com/developerworks/community/groups/community/lozopensource)

# Update and install packages for compiling
RUN apt-get update && apt-get install -y \
bzip2 \
curl \
g++ \
gcc \
libbz2-dev \
libbz2-dev \
libc6-dev \
libgdbm-dev \
libgdbm-dev \
libncurses5-dev \
libreadline6-dev \
libsqlite3-dev \
Expand All @@ -49,34 +52,35 @@ RUN apt-get update && apt-get install -y \
patch \
tar \
wget \
xz-utils \
zlib1g-dev \
libdb1-compat \
libdb-dev \
tk8.5-dev \
gdb \
xz-utils \
zlib1g-dev \
libdb1-compat \
libdb-dev \
tk8.5-dev \
gdb

# Pull python source
RUN wget https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tar.xz \
&& tar -xvf Python-${PYTHON_VER}.tar.xz

# Download Python from the ftp site
&& wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tar.xz \
&& tar -xvf Python-2.7.15.tar.xz \

# Build Python
&& ./configure --prefix=/usr/local --exec-prefix=/usr/local \
# Build python with optimizations
RUN cd Python-${PYTHON_VER} \
&& ./configure --enable-optimizations --prefix=/usr/local --exec-prefix=/usr/local \
&& make \
&& make install \
&& make install

# Clean up cache data and remove dependencies that are not required
&& apt-get remove -y \
RUN apt-get remove -y \
bzip2 \
curl \
g++ \
gcc \
make \
patch \
wget \
xz-utils \
xz-utils \
&& apt autoremove -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/Python-2.7.15.tar.xz /root/Python-2.7.15
&& rm -rf /Python-${PYTHON_VER}.tar.xz /Python-${PYTHON_VER}

CMD python --version
25 changes: 14 additions & 11 deletions Python/3.x/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,43 +30,46 @@
# Base image
FROM s390x/ubuntu:16.04

ARG PYTHON_VER=3.6.5

# The author
MAINTAINER LoZ Open Source Ecosystem (https://www.ibm.com/developerworks/community/groups/community/lozopensource)

# Update and install packages for compiling
RUN apt-get update && apt-get install -y \
g++ \
gcc \
libbz2-dev \
libbz2-dev \
libc6-dev \
libgdbm-dev \
libgdbm-dev \
libncurses5-dev \
libreadline6-dev \
libsqlite3-dev \
libssl-dev \
make \
tar \
wget \
xz-utils \
xz-utils

# Download Python from the ftp site
&& wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz \
&& tar -xvf Python-3.6.5.tar.xz \
RUN wget https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tar.xz \
&& tar -xvf Python-${PYTHON_VER}.tar.xz

# Build Python
&& cd Python-3.6.5 \
&& ./configure --prefix=/usr/local --exec-prefix=/usr/local \
RUN cd Python-${PYTHON_VER} \
&& ./configure --enable-optimizations --prefix=/usr/local --exec-prefix=/usr/local \
&& make \
&& make install \
&& make install

# Clean up cache data and remove dependencies that are not required
&& apt-get remove -y \
RUN apt-get remove -y \
g++ \
gcc \
make \
wget \
xz-utils \
xz-utils \
&& apt autoremove -y \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& rm -rf /root/Python-3.6.5.tar.xz /root/Python-3.6.5
&& rm -rf /Python-${PYTHON_VER}.tar.xz /Python-${PYTHON_VER}

CMD python3 --version