Skip to content

Instantly share code, notes, and snippets.

@cicorias
Created February 23, 2019 05:54
Show Gist options
  • Save cicorias/3d16aad1f48e9d04995029edee46f59b to your computer and use it in GitHub Desktop.
Save cicorias/3d16aad1f48e9d04995029edee46f59b to your computer and use it in GitHub Desktop.
pyenv in alpine docker
ARG PYTHON_VERSION=3.7.0-alpine3.8
FROM python:${PYTHON_VERSION} as builder
RUN apk add --update make \
cmake \
g++
RUN apk add \
git \
bash \
build-base \
linux-headers \
bzip2 \
bzip2-dev \
sqlite-dev \
zlib-dev \
curl \
libffi-dev \
ncurses-dev \
openssl-dev \
readline-dev \
tk-dev \
xz-dev \
zlib-dev
RUN pip install pytest tox
RUN pip install tox-globinterpreter
ENV HOME /root
ENV PYENV_ROOT $HOME/.pyenv
ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
RUN curl https://pyenv.run | bash
RUN pyenv install 3.5.6
RUN pyenv global 3.5.6
RUN pyenv install 3.6.8
RUN pyenv virtualenv -p python3.5 3.5.6 py35
RUN pyenv virtualenv -p python3.6 3.6.8 py36
WORKDIR /app
ENTRYPOINT [ "bash" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment