DirectorySecurity advisories
Sign in

Directory

python logo

python

Last changed
Get started with latest for free
docker pull cgr.dev/chainguard/python

Need access to a specific version? Contact us.

Sign in for updates

Get notified of upcoming product changes, critical vulnerability notifications and patches and more.

Sign in
Versions
Overview
Provenance
Specifications
SBOM
Vulnerabilities
Advisories

Minimal Python image based on Wolfi.

Download this Image

The image is available on cgr.dev:

docker pull cgr.dev/chainguard/python:latest

Variants

We have two images available: a python:latest-dev variant that contains pip and a shell, and a minimal runtime image that just contains python itself.

These images are available on cgr.dev:

docker pull cgr.dev/chainguard/python:latest
docker pull cgr.dev/chainguard/python:latest-dev

Note that in order to access the shell in the python:latest-dev image, you'll need to include an --entrypoint option, as in the following example.

docker run -it --entrypoint /bin/bash chainguard/python:latest-dev

Usage

The python image can be used directly for simple cases, or with a multi-stage build using python-dev as the build container.

FROM cgr.dev/chainguard/python:latest-dev as builder

WORKDIR /app

COPY requirements.txt .

RUN pip install -r requirements.txt --user

FROM cgr.dev/chainguard/python:latest

WORKDIR /app

# Make sure you update Python version in path
COPY --from=builder /home/nonroot/.local/lib/python3.12/site-packages /home/nonroot/.local/lib/python3.12/site-packages

COPY main.py .

ENTRYPOINT [ "python", "/app/main.py" ]
Licenses

Chainguard Images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" version of this image:

  • Apache-2.0

  • GCC-exception-3.1

  • GPL-2.0-or-later

  • GPL-3.0-or-later

  • LGPL-2.1-or-later

  • MIT

  • MPL-2.0

View more

For a complete list of licenses, please refer to this Image's SBOM.

Software license agreement

Related images

Category
featured
base
languages

Products

Chainguard Images

© 2024 Chainguard, Inc.