What does it do?#
Three environment variables let you adjust container behaviour without modifying aliases.
DOCKER_DEVTOOLS_TTY#
Controls whether -it (interactive + TTY) is passed to docker run.
| Value | Behaviour |
|---|---|
always (default) | Always pass -it |
auto | Pass -it only when stdin and stdout are connected to a terminal |
never | Never pass -it (safe for scripts and CI) |
# Disable TTY for use in a CI pipeline or script
DOCKER_DEVTOOLS_TTY=never phpcs-generic src/DOCKER_DEVTOOLS_MAP_HOST_USER#
When set to a truthy value (true, 1, yes, on), adds --user $(id -u):$(id -g) so files written by the container are owned by the current host user instead of root.
DOCKER_DEVTOOLS_MAP_HOST_USER=true composer-docker installAccepts: true, 1, yes, on (enable) or false, 0, no, off, empty (disable — default).
DOCKER_DEVTOOLS_EXTRA_ARGS#
A space-separated list of extra flags appended to docker run before the image name. Useful for network, registry, or pull-policy overrides.
# Force a fresh pull and use the host network
DOCKER_DEVTOOLS_EXTRA_ARGS="--pull always --network host" stylelint-docker .You can export these variables in your shell profile to apply them globally:
export DOCKER_DEVTOOLS_TTY=auto
export DOCKER_DEVTOOLS_MAP_HOST_USER=trueTroubleshooting#
docker-devtools: docker is not installed or not in PATH.
Docker is missing or the daemon is not running. Install Docker or ensure docker is on your PATH.
Output files are owned by root
Set DOCKER_DEVTOOLS_MAP_HOST_USER=true so the container runs as your UID/GID.
the input device is not a TTY in a script or CI
Set DOCKER_DEVTOOLS_TTY=never (or auto) to suppress the -it flag.
invalid DOCKER_DEVTOOLS_TTY value
The variable must be exactly always, auto, or never.
invalid DOCKER_DEVTOOLS_MAP_HOST_USER value
The variable must be a recognised boolean: true/false, 1/0, yes/no, or on/off.
docker_alias requires a working directory and image.
An alias was called incorrectly (fewer than 2 arguments to docker_alias) — this normally indicates a broken custom alias rather than a user error.
--entrypoint requires a value. (Bash only)
You passed --entrypoint in a custom alias without following it with an entrypoint name.
Platform support#
Not every tool group has full parity between Bash/zsh and PowerShell. See the dedicated PowerShell page for setup, usage and the full breakdown — summary below:
| Group | Bash / zsh | PowerShell |
|---|---|---|
Core (docker_alias / Invoke-DockerAlias) | ✅ | ✅ (no --entrypoint support) |
| PHP | ✅ | ✅ |
| JavaScript / CSS | ✅ | ⚠️ outdated — different images, missing eslint-docker/pnpm-docker |
| Python | ✅ | ❌ not implemented |
| Images | ✅ (8 aliases) | ⚠️ partial — only jpegtran-docker |
| AI tools | ✅ | ❌ not implemented |
| Internet tools | ✅ (7 aliases) | ✅ full parity |
Testing#
A shell-based test harness stubs out Docker and the alias sub-files so no containers are pulled:
bash tests/run_tests.shA matching PowerShell harness (tests/run_tests.ps1) covers the same scenarios for the .ps1 scripts:
pwsh tests/run_tests.ps1The Sources#
GitHub: https://github.com/willhallonline/docker-devtools-aliases