A minimal Ubuntu 24.04 development container with:
- zsh + oh-my-zsh
- zsh-syntax-highlighting, zsh-autosuggestions
- A simple prompt label (
HOST_LABEL) to distinguish environments (e.g.,user@dev)
This repo is intentionally small and generic so it can be used as a public base repo.
Dockerfile: base image and packagesconfig.env: defaults (user/image/container names)build.sh: build imagerun.sh: create/start containerinit.sh: set password, setHOST_LABEL, install oh-my-zsh + plugins, copy.zshrcsetup.sh: one-shot script (asks inputs first, then build/run/init)enter.sh: enter the container with zsh login shellzshrc:.zshrctemplate copied into the container
See config.env:
USER_NAME="user"
IMAGE_NAME="ubuntu-dev-env:24.04"
CONTAINER_NAME="docker-env"
You can change these values by editing config.env.
- Build + run + init in one command:
./setup.sh
You will be prompted for:
- Password (for
USER_NAMEinside the container) HOST_LABEL(used only for the prompt label)
Example prompt behavior:
- If
USER_NAME=userand you enterHOST_LABEL=dev- your prompt becomes
user@dev
- your prompt becomes
- Next time, just enter:
./enter.sh
If you prefer separate steps:
./build.sh
./run.sh
./init.sh
./enter.sh
Notes:
init.shinstalls oh-my-zsh and plugins only if missing.run.shcreates the container if it does not exist, otherwise it starts it.
HOST_LABEL is a small string shown in your zsh prompt to identify the environment.
It is written into ~/.zshenv inside the container as an exported variable:
export HOST_LABEL="dev"
Your .zshrc prompt uses it so you can see:
user@devuser@wsluser@server1etc.
It does not affect Docker, networking, or anything else.
setup.sh passes inputs to init.sh via environment variables:
DOCKER_ENV_PASSWORDDOCKER_ENV_HOST_LABEL
So you can also run init.sh directly without prompts:
DOCKER_ENV_PASSWORD="your_password" \
DOCKER_ENV_HOST_LABEL="dev" \
./init.sh
(If these variables are not set, init.sh will prompt interactively.)
./enter.sh
This starts the container (if stopped) and opens an interactive zsh login shell.
Remove the container:
docker stop docker-env || true
docker rm docker-env
Remove the image:
docker rmi ubuntu-dev-env:24.04
If you changed names in config.env, use those names instead.
- This container runs
sshdby default (CMD ["/usr/sbin/sshd", "-D"]), but you do not have to use SSH. - Locale is set to
en_US.UTF-8only (noko_KR.UTF-8), to keep the public repo generic. - UID/GID are fixed (
1100) for convenience when bind-mounting files between host and container.- Adjust in
Dockerfileif needed.
- Adjust in