Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

Dev Container

trigen/dev-container:latest

Main image for development based on Ubuntu 25.04 with preinstalled Oh my Zsh and Asdf, and configured PNPM cache.

docker run -it \
  -v $(pwd):/workspace \
  -v $(pwd)/home:/root \
  -v $(pwd)/.cache:/cache \
  trigen/dev-container:latest

Mount points:

Path Description
/workspace Your project(s) directory
/root Home directory — shell/tool configs, ssh keys, tokens (persisted as a whole)
/cache Cache for asdf, pnpm, zsh history, git config; the data of the Docker daemon inside the container

Note

The whole home directory is persisted, so any tool that writes to $HOME keeps its data across restarts without adding a new mount. Configs baked into the image (Oh My Zsh, .zshrc) are seeded into an empty home/ on first start and never overwrite your own files afterwards. Since this directory holds ssh keys and auth tokens, keep it out of synced/backed-up/committed locations.

Docker inside the container

The image has Docker Engine and the docker CLI with the Compose and Buildx plugins. A privileged container starts its own Docker daemon, so docker and docker compose work inside it and stay apart from the host's Docker:

docker run -it --privileged \
  -v $(pwd):/workspace \
  -v $(pwd)/home:/root \
  -v $(pwd)/.cache:/cache \
  trigen/dev-container:latest
  • The daemon's images, containers and volumes live in /cache/docker, so they survive the container.
  • Paths are the container's own: docker compose mounts files from /workspace as you see them.
  • A container that is not privileged starts no daemon. Mount the host's /var/run/docker.sock into it to use the host's Docker with the same CLI.
  • The daemon's log is /var/log/dockerd.log.

With --network host the container shares its network with the host's Docker daemon, and a second daemon there would fight it for docker0 and for the firewall rules. The daemon then runs in a network namespace of its own, connected to the outside in user space by pasta: the host's interfaces and firewall are not touched. A port published on 127.0.0.1 is reachable from the dev container only; a port published on every address is reachable wherever the host is.

Environment variables:

Name Description Default
DOCKER_DAEMON auto starts the daemon when the container is privileged and no socket is mounted; on fails the start when it cannot run; off never starts it auto
DOCKER_NETWORK auto isolates the daemon's network when the container uses the host network; isolated or direct force one auto
DOCKER_DATA_ROOT Where the daemon keeps its data /cache/docker
DOCKERD_ARGS Extra arguments for dockerd

Note

When the container stops, the daemon and the containers inside it are killed, not stopped one by one. Stop what needs a clean shutdown with docker compose stop first.

trigen/dev-container:tunnel

Image to run VS Code Remote Tunnels.

docker run -it \
  --hostname dev-container \
  -v $(pwd):/workspace \
  -v $(pwd)/home:/root \
  -v $(pwd)/.cache:/cache \
  trigen/dev-container:tunnel

Note

--hostname should be the same each run for VS Code Tunnel session reuse

Mount points:

Path Description
/workspace Your project(s) directory
/root Home directory — shell/tool configs, ssh keys, tokens (persisted as a whole)
/cache Cache for asdf, pnpm, zsh history, git config

Environment variables:

Name Description Default
TUNNEL_NAME Name of the tunnel dev-container
TUNNEL_PROVIDER Authentication provider (github or microsoft) github

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages