Skip to content

Commit 22a6039

Browse files
feat: Preparing next release
1. Shuffle a bit multistaged build 2. Ensure gcc & g++ still installed 3. Update README & CHANGELOG files
1 parent a546d7a commit 22a6039

3 files changed

Lines changed: 52 additions & 38 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 4.2.0 (In Development)
2+
3+
- Update `py39` image to Python 3.9.2
4+
- Update pip to 21.0.1
5+
- Update pre-commit to 20.10.1
6+
- Update tox to 3.22.0
7+
- Update virtualenv to 20.4.2
8+
19
# 4.1.0 (2021-01-05)
210

311
- Update `py39` image to Python 3.9.1

Dockerfile

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
1+
# TODO: Find out whether it possible to use "faster" base Python image
12
FROM python:3.9.2-slim-buster as python-base
23

34
LABEL maintainer="Igor Davydenko <iam@igordavydenko.com>"
45
LABEL description="Add poetry, pre-commit, and other dev-tools to official Python slim Docker image."
56

6-
# poetry envirnment
7-
ENV POETRY_HOME="/opt/poetry"
8-
ENV POETRY_NO_INTERACTION=1
7+
# Ensure to use latest system versions
8+
RUN apt update -qq && apt upgrade -y && apt autoremove -y
99

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
10+
# Global poetry setup
11+
ENV POETRY_HOME "/opt/poetry"
12+
ENV POETRY_NO_INTERACTION "1"
13+
ENV PATH "${POETRY_HOME}/bin:${PATH}"
1614

17-
# additonal applications to install
15+
# Install poetry at one stage
16+
FROM python-base as poetry-base
17+
18+
ENV POETRY_VERSION "1.1.4"
19+
RUN apt install -y build-essential curl
20+
RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
21+
RUN poetry --version
22+
23+
# Install dev tools at another stage
24+
FROM python-base as development-base
25+
26+
# Additonal applications to install
1827
ENV ADDITIONAL_APPS \
1928
curl \
29+
g++ \
30+
gcc \
2031
gettext \
2132
git \
2233
locales \
@@ -25,31 +36,26 @@ ENV ADDITIONAL_APPS \
2536
nano \
2637
openssh-client \
2738
rsync
39+
RUN apt install -y ${ADDITIONAL_APPS} && apt autoremove -y
40+
41+
# To check latest versions,
42+
#
43+
# ```bash
44+
# pip-latest-release pip pre-commit tox virtualenv
45+
# ```
46+
ENV PIP_VERSION "21.0.1"
47+
ENV PRE_COMMIT_VERSION "2.10.1"
48+
ENV TOX_VERSION "3.22.0"
49+
ENV VIRTUALENV_VERSION "20.4.2"
2850

29-
# prepend poetry
30-
ENV PATH="$POETRY_HOME/bin:$PATH"
31-
32-
RUN apt update -qq \
33-
&& apt upgrade -y \
34-
&& apt autoremove -y
35-
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
42-
43-
44-
FROM python-base as development-base
45-
RUN apt install -y $ADDITIONAL_APPS && apt autoremove -y
4651
RUN pip install \
47-
pip==$PIP_VERSION \
48-
pre-commit==$PRE_COMMIT_VERSION \
49-
tox==$TOX_VERSION \
50-
virtualenv==$VIRTUALENV_VERSION
52+
pip==${PIP_VERSION} \
53+
pre-commit==${PRE_COMMIT_VERSION} \
54+
tox==${TOX_VERSION} \
55+
virtualenv==${VIRTUALENV_VERSION}
5156

52-
COPY --from=poetry-builder-base $POETRY_HOME $POETRY_HOME
57+
# Copy poetry from previous stage
58+
COPY --from=poetry-base ${POETRY_HOME} ${POETRY_HOME}
5359

5460
WORKDIR /app
5561
CMD ["python3"]

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ image.
99
## Usage
1010

1111
```dockerfile
12-
FROM playpauseandstop/docker-python:4.0.0
12+
FROM playpauseandstop/docker-python:4.1.0
1313
```
1414

1515
### Included dev-tools
1616

17-
- [pip](https://pip.pypa.io) 20.3.3
17+
- [pip](https://pip.pypa.io) 21.0.1
1818
- [poetry](https://python-poetry.org) 1.1.4
19-
- [pre-commit](https://pre-commit.com) 2.9.3
20-
- [tox](https://tox.readthedocs.io/) 3.20.1
21-
- [virtualenv](https://virtualenv.pypa.io) 20.2.2
19+
- [pre-commit](https://pre-commit.com) 2.10.1
20+
- [tox](https://tox.readthedocs.io/) 3.22.0
21+
- [virtualenv](https://virtualenv.pypa.io) 20.4.2
2222
- [curl](https://curl.haxx.se) 7.64.0
23+
- [gcc & g++](https://gcc.gnu.org) 8.3.0
2324
- [git](https://git-scm.com) 2.20.1
2425
- [locales](https://packages.debian.org/stretch/locales) &
2526
[locales-all](https://packages.debian.org/stretch/locales-all)
26-
- [gcc & g++](https://gcc.gnu.org) 8.3.0
2727
- [make](https://www.gnu.org/software/make) 4.2.1
2828
- [nano](https://www.nano-editor.org) 3.2
2929
- [gettext](https://www.gnu.org/software/gettext) 0.19.8.1

0 commit comments

Comments
 (0)