Public repository for ragedunicorn docker python images
2.2K

A minimal Python image on Alpine Linux, shipping a pinned standalone CPython decoupled from the Alpine release.
# Pull latest version
docker pull ragedunicorn/python:latest
# Or pull specific version (see the Tags tab for the available versions)
docker pull ragedunicorn/python:<python-major>-alpine<alpine-version>-<build>
# Run Python interactively
docker run -it --rm ragedunicorn/python:latest
# Run a Python script
docker run -v $(pwd):/app ragedunicorn/python:latest script.py
On Windows, use the PowerShell form - ${PWD} with braces and the colon
inside the quotes (without braces PowerShell parses $PWD: as a
scope-qualified variable, as in $env:PATH, and rejects the argument):
# Run a Python script
docker run -v "${PWD}:/app" ragedunicorn/python:latest script.py
docker run -v $(pwd):/app ragedunicorn/python:latest script.py
PowerShell:
docker run -v "${PWD}:/app" ragedunicorn/python:latest script.py
docker run -it --rm ragedunicorn/python:latest
docker run --rm ragedunicorn/python:latest -c "print('Hello, World!')"
# Install and run pytest
docker run --rm -v $(pwd):/app --entrypoint /bin/sh ragedunicorn/python:latest -c "pip install pytest && python -m pytest"
# Install and use Black formatter
docker run --rm -v $(pwd):/app --entrypoint /bin/sh ragedunicorn/python:latest -c "pip install black && python -m black ."
PowerShell - single quotes keep the sh -c command one literal argument, so
&& runs inside the container:
# Install and run pytest
docker run --rm -v "${PWD}:/app" --entrypoint /bin/sh ragedunicorn/python:latest -c 'pip install pytest && python -m pytest'
# Install and use Black formatter
docker run --rm -v "${PWD}:/app" --entrypoint /bin/sh ragedunicorn/python:latest -c 'pip install black && python -m black .'
FROM ragedunicorn/python:latest
# Install additional packages
USER root
RUN pip install django flask fastapi
USER python
# Your custom configuration
WORKDIR /app
COPY . .
CMD ["python", "app.py"]
This image uses semantic versioning that includes all component versions:
Format: {python_major_version}-alpine{alpine_version}-{build_number}
X is the Python major version, A.B.C the Alpine version:
X-alpineA.B.C-1 - Initial release with Python X and Alpine A.B.CX-alpineA.B.C-2 - Rebuild of same versions (bug fixes, security patches)X-alpineA.B.D-1 - Alpine Linux patch updateX - Most recent build of Python Xlatest - Most recent stable releaseThe available versions are listed in the Tags tab.
The pinned CPython patch version is fixed per release and updated independently of Alpine. When updates are available through automated dependency management, new releases are created with appropriate version tags.
PYTHONUNBUFFERED=1 - Unbuffered outputThe default working directory is /app. Mount your code here:
docker run -v $(pwd):/app ragedunicorn/python:latest your_script.py
PowerShell:
docker run -v "${PWD}:/app" ragedunicorn/python:latest your_script.py
MIT License - See GitHub repository for details.
Content type
Image
Digest
sha256:11899e0f4…
Size
32.5 MB
Last updated
18 days ago
docker pull ragedunicorn/python