File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM python:3.9.1-slim-buster
1+ FROM python:3.9.1-slim-buster as python-base
22
33LABEL maintainer="Igor Davydenko <iam@igordavydenko.com>"
44LABEL description="Add poetry, pre-commit, and other dev-tools to official Python slim Docker image."
55
6+ # poetry envirnment
7+ ENV POETRY_HOME="/opt/poetry"
8+ ENV POETRY_NO_INTERACTION=1
9+
10+ # versions
11+ ENV POETRY_VERSION=1.1.4
12+ ENV PIP_VERSION 20.3.3
13+ ENV PRE_COMMIT_VERSION 2.9.3
14+ ENV TOX_VERSION 3.20.1
15+ ENV VIRTUALENV_VERSION 20.2.2
16+
17+ # additonal applications to install
18+ ENV ADDITIONAL_APPS \
19+ curl \
20+ gettext \
21+ git \
22+ locales \
23+ locales-all \
24+ make \
25+ nano \
26+ openssh-client \
27+ rsync
28+
29+ # prepend poetry
30+ ENV PATH="$POETRY_HOME/bin:$PATH"
31+
632RUN apt update -qq \
733 && apt upgrade -y \
8- && apt install -y curl gcc g++ gettext git locales locales-all make nano openssh-client rsync \
934 && apt autoremove -y
1035
11- ENV PATH="/root/.local/bin:/root/.poetry/bin:${PATH}"
36+ FROM python-base as poetry-builder-base
37+ RUN apt install -y \
38+ curl \
39+ build-essential
40+ RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
41+ RUN poetry --version
1242
13- RUN pip install pip==20.3.3 pre-commit==2.9.3 tox==3.20.1 virtualenv==20.2.2
1443
15- ENV POETRY_VERSION=1.1.4
16- RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
44+ FROM python-base as development-base
45+ RUN apt install -y $ADDITIONAL_APPS && apt autoremove -y
46+ RUN pip install \
47+ pip==$PIP_VERSION \
48+ pre-commit==$PRE_COMMIT_VERSION \
49+ tox==$TOX_VERSION \
50+ virtualenv==$VIRTUALENV_VERSION
51+
52+ COPY --from=poetry-builder-base $POETRY_HOME $POETRY_HOME
1753
1854WORKDIR /app
1955CMD ["python3" ]
You can’t perform that action at this time.
0 commit comments