Skip to content

Instantly share code, notes, and snippets.

@joalbertg
Created April 29, 2020 19:42
Show Gist options
  • Select an option

  • Save joalbertg/e041beb51e440dbf627ecb8bfb792b9b to your computer and use it in GitHub Desktop.

Select an option

Save joalbertg/e041beb51e440dbf627ecb8bfb792b9b to your computer and use it in GitHub Desktop.
docker: alphine-python3
# By: https://github.com/Docker-Hub-frolvlad
FROM alpine:3.11
# This hack is widely applied to avoid python printing issues in docker containers.
# See: https://github.com/Docker-Hub-frolvlad/docker-alpine-python3/pull/13
ENV PYTHONUNBUFFERED=1
RUN echo "**** install Python ****" && \
apk add --no-cache python3 && \
if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python ; fi && \
\
echo "**** install pip ****" && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --no-cache --upgrade pip setuptools wheel && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment