Skip to content

Commit

Permalink
Bump python versions to 3.10.12 and 3.11.4
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Aug 5, 2023
1 parent e27bb03 commit c6934c0
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 13 deletions.
10 changes: 5 additions & 5 deletions python/3.10/jammy/Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG CONTAINER_REGISTRY=docker.io
FROM $CONTAINER_REGISTRY/ubuntu:jammy-20230308
FROM $CONTAINER_REGISTRY/ubuntu:jammy-20230624

# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
Expand Down Expand Up @@ -37,7 +37,7 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.10.10
ENV PYTHON_VERSION 3.10.12

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,SC2015
Expand Down Expand Up @@ -115,12 +115,12 @@ RUN set -eux; \
done

# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 22.3.1
ENV PYTHON_PIP_VERSION 23.0.1
# https://github.com/docker-library/python/issues/365
ENV PYTHON_SETUPTOOLS_VERSION 65.5.1
# https://github.com/pypa/get-pip
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/1a96dc5acd0303c4700e02655aefd3bc68c78958/public/get-pip.py
ENV PYTHON_GET_PIP_SHA256 d1d09b0f9e745610657a528689ba3ea44a73bd19c60f4c954271b790c71c2653
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/9af82b715db434abb94a0a6f3569f43e72157346/public/get-pip.py
ENV PYTHON_GET_PIP_SHA256 45a2bb8bf2bb5eff16fdd00faef6f29731831c7c59bd9fc2bf1f3bed511ff1fe

RUN set -eux; \
\
Expand Down
2 changes: 1 addition & 1 deletion python/3.10/jammy/Polly.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[container_image]
name = 'python'
tags = ["3.10.9-jammy", "3.10-jammy", "3-jammy", "jammy"]
tags = ["3.10.12-jammy", "3.10-jammy", "3-jammy", "jammy"]
readme = "python/README.md"
10 changes: 5 additions & 5 deletions python/3.11/jammy/Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1
ARG CONTAINER_REGISTRY=docker.io
FROM $CONTAINER_REGISTRY/ubuntu:jammy-20230308
FROM $CONTAINER_REGISTRY/ubuntu:jammy-20230624

# ensure local python is preferred over distribution python
ENV PATH /usr/local/bin:$PATH
Expand Down Expand Up @@ -37,7 +37,7 @@ RUN set -eux; \
rm -rf /var/lib/apt/lists/*

ENV GPG_KEY A035C8C19219BA821ECEA86B64E628F8D684696D
ENV PYTHON_VERSION 3.11.2
ENV PYTHON_VERSION 3.11.4

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3003,SC2015
Expand Down Expand Up @@ -115,12 +115,12 @@ RUN set -eux; \
done

# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 22.3.1
ENV PYTHON_PIP_VERSION 22.3.2
# https://github.com/docker-library/python/issues/365
ENV PYTHON_SETUPTOOLS_VERSION 65.5.1
# https://github.com/pypa/get-pip
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/1a96dc5acd0303c4700e02655aefd3bc68c78958/public/get-pip.py
ENV PYTHON_GET_PIP_SHA256 d1d09b0f9e745610657a528689ba3ea44a73bd19c60f4c954271b790c71c2653
ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/9af82b715db434abb94a0a6f3569f43e72157346/public/get-pip.py
ENV PYTHON_GET_PIP_SHA256 45a2bb8bf2bb5eff16fdd00faef6f29731831c7c59bd9fc2bf1f3bed511ff1fe

RUN set -eux; \
\
Expand Down
2 changes: 1 addition & 1 deletion python/3.11/jammy/Polly.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[container_image]
name = 'python'
tags = ["3.11.1-jammy", "3.11-jammy", "3-jammy", "jammy"]
tags = ["3.11.4-jammy", "3.11-jammy", "3-jammy", "jammy"]
readme = "python/README.md"
37 changes: 36 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,39 @@ This image packages releases from https://github.com/docker-library/python

For best practices on using Python container images, refer to https://pythonspeed.com/docker/

Source location: https://github.com/boxcutter/oci/tree/main/python
## Using python

### Running the Python Read-Eval-Print Loop (REPL)

The Python interpreter is the default command running in this image. Typing an end-of-file character (`Control-D` on Linux, `Control-Z` on Windows) causes the interpreter to exit. You can also exit the interpret by typing in the command: `quit()`.

```
docker run -it --rm \
docker.io/boxcutter/python:3.11-jammy
```

### Run a single Python script

For single file projects, you can run a Python script by using the container image directly:

```
docker run -it --rm \
--mount type=bind,source="$(pwd)",target=/usr/src/myapp \
--workdir /usr/src/myapp \
docker.io/boxcutter/python:3.11-jammy python your-script.py
```

### Create a Containerfile in your Python app project

```
FROM docker.io/polymathrobotics/python:3.11-jammy
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD [ "python", "./your-daemon-or-script.py" ]
```

0 comments on commit c6934c0

Please sign in to comment.