fcc98eada9f1efeccd15ae92603842261005650f
🐳 code-server Dev Container with Docker-in-Docker
A developer container powered by code-server, with full Docker CLI support via Docker-in-Docker (DinD). Authentication and user setup is driven by environment variables via .env – ideal for ephemeral, configurable environments.
Features
- 💻 code-server (VS Code in the browser)
- 🐳 Docker-in-Docker (DinD)
- 🔐 Password or hashed password auth via
.env - 👤 Dynamic user configuration (UID, GID, password)
- ⚙️ Preinstalled: Docker, AWS CLI v2, kubectl, eksctl, Node.js, Python, Java, pre-commit, etc.
Build
docker build -t code-server-dind .
Environment Configuration (.env)
Create a .env file to define user credentials and setup:
DOCKER_USER=coder
UID=1000
GID=1000
TZ=Asia/Taipei
PASSWORD=yourpassword
# Or alternatively:
# HASHED_PASSWORD=$argon2id$v=19$m=65536,t=3,p=4$...
Note: Set only one of
PASSWORDorHASHED_PASSWORD. UsePASSWORD=noneto disable authentication.
Run
docker run --rm -it \
--privileged \
-v code-server-home:/home/coder \
--env-file .env \
-p 8080:8080 \
code-server-dind
Volume
All work is persisted in /home/coder, mounted via Docker volume code-server-home.
Authentication Modes
PASSWORD=yourpass: sets a plain password.HASHED_PASSWORD=...: sets a secure pre-hashed password.PASSWORD=none: disables authentication (not recommended for public use).
Access
Once running, visit: http://localhost:8080
Login using the credentials defined in .env.
Tooling Included
- Docker CLI
- AWS CLI v2
- kubectl (
v1.32.0) - eksctl
- Node.js + npm
- Python 3 + venv + pipx
- Java Runtime (default-jre)
- pre-commit
- siege, jq, git, etc.
🧹 Clean Up
docker volume rm code-server-home
📝 License
This document is distributed under the terms of the GNU General Public License v3 or later. See the LICENSE file for more details.
Description
Languages
Dockerfile
54.3%
Shell
45.7%