Files
code-server-dind/README.md
Astounds fe58d6a3d1
Some checks failed
release / release-default (push) Failing after 16s
feat: add fuse-overlayfs storage driver for Docker-in-Docker
- Install fuse-overlayfs package in Dockerfile
- Configure Docker daemon to use fuse-overlayfs storage driver
- Add daemon.json configuration in entrypoint.sh
- Update documentation in README.md and README.es.md

This enables Docker-in-Docker to work efficiently in unprivileged
containers without requiring the overlay2 driver.
2026-02-11 10:53:17 -05:00

87 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 🐳 code-server Dev Container with Docker-in-Docker
A developer container powered by [code-server](https://github.com/coder/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) with fuse-overlayfs storage driver
- 🔐 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
```bash
docker build -t code-server-dind .
```
## Environment Configuration (`.env`)
Create a `.env` file to define user credentials and setup:
```env
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 `PASSWORD` or `HASHED_PASSWORD`. Use `PASSWORD=none` to disable authentication.
## Run
```bash
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](http://localhost:8080)
Login using the credentials defined in `.env`.
## Tooling Included
- Docker CLI (with fuse-overlayfs storage driver for unprivileged containers)
- AWS CLI v2
- kubectl (`v1.33.0`)
- eksctl
- Node.js + npm
- Python 3 + venv + pipx
- Java Runtime (default-jre)
- pre-commit
- siege, jq, git, etc.
## Docker Storage Driver
This container uses `fuse-overlayfs` as the Docker storage driver, which allows Docker-in-Docker to work efficiently in unprivileged containers without requiring the `overlay2` driver. The configuration is automatically set in `/etc/docker/daemon.json` during container startup.
## Clean Up
```bash
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](LICENSE) file for more details.