Specially created Docker image for Python to work as a devcontainer for development purposes.
NOTE: This image is NOT meant to be used as a production image.
It contains:
uv- for Python package managementpython- Python version that is defined in.python-versionfile in the child image.
It contains the necessary dependencies for running various linters and type checkers:
watchman- for running Pyre Python type checkershfmt- for shell script formattingshellcheck- for shell script lintingreviewdog- for code reviewhadolint- for linting Dockerfileactionlint- static checker for GitHub Actions workflow filestaplo- TOML formatter and linter
Alternative unix power tools:
rg(ripgrep) - better alternative togrepfd- better alternative tofindbtop- better alternative totop/htopeza- better alternative tols(symlinked to replacels)dust- better alternative todubat- better alternative tocatdelta- better diff pager forgit,diff,grep,...fzf- fuzzy findertokei- code counterhyperfine- benchmarking tool
We host the image on Github packages.
You can use it the like this:
Command line:
docker run --rm ghcr.io/nextgencontributions/python-dev-imageIn your project's Dockerfile:
FROM ghcr.io/nextgencontributions/python-dev-image # AS scratch
# Do your own customizations here...NOTE: When using this as a base image, you should have the following files available in your build context:
pyproject.tomluv.lock.python-version- this will be used to install the Python version in the container.
If you don't have these files, you can create them by running the following commands:
uv init
uv lock
uv python pin 3.12 # or replace with any other Python version you wantOr in a single command in your project's root directory:
docker run --rm -v $(pwd):/app ghcr.io/nextgencontributions/python-dev-image \
sh -c "cd /app && uv init && uv lock && uv python pin 3.12"With VSCode in .devcontainer/devcontainer.json: