What does it do?#
Runs Python and common formatting, linting, type-checking and security-scanning tools inside Docker containers — no local Python install required.
Commands#
Commands you can run to use this.
Aliases#
| Alias | Tool | Image |
|---|---|---|
python-docker | Python REPL / scripts | python:alpine |
pip-docker | pip package manager | python:alpine |
python-bash-docker | Interactive shell in Python container | python:alpine |
black-docker | Black code formatter | pyfound/black:latest_release |
flake8-docker | Flake8 style/lint checker (PEP 8) | alpine/flake8:latest |
pylint-docker | Pylint static analysis | cytopia/pylint:latest |
mypy-docker | Mypy static type checker | cytopia/mypy:latest |
bandit-docker | Bandit security linter | cytopia/bandit:latest |
Usage#
# Run a Python script
python-docker script.py
# Install dependencies
pip-docker install -r requirements.txt
# Format code with Black
black-docker .
# Lint with Flake8 / Pylint
flake8-docker .
pylint-docker mypackage/
# Type-check with Mypy
mypy-docker mypackage/
# Scan for security issues with Bandit
bandit-docker -r mypackage/Note:
python-bash-dockerdrops you into/bin/sh, notbash— thepython:alpineimage doesn’t ship Bash.black-dockerintentionally uses the tagpyfound/black:latest_release(not:latest), which is the official Black image’s published “latest stable release” tag.
PowerShell caveat:
python/docker-python-devtools.ps1now exists and is auto-sourced bydocker-devtools.ps1, but it’s not quite full parity yet —ruff-dockerandpoetry-dockerhave no PowerShell equivalent. Everything else (python-docker,pip-docker,python-bash-docker,black-docker,flake8-docker,pylint-docker,mypy-docker,bandit-docker) works the same in both shells. See the PowerShell page for the full platform-parity breakdown.
The Sources#
GitHub: https://github.com/willhallonline/docker-devtools-aliases