Skip to content

topcue-env/docker-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-env

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.


Files

  • Dockerfile: base image and packages
  • config.env: defaults (user/image/container names)
  • build.sh: build image
  • run.sh: create/start container
  • init.sh: set password, set HOST_LABEL, install oh-my-zsh + plugins, copy .zshrc
  • setup.sh: one-shot script (asks inputs first, then build/run/init)
  • enter.sh: enter the container with zsh login shell
  • zshrc: .zshrc template copied into the container

Defaults

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.


Quick start (recommended)

  1. Build + run + init in one command:
./setup.sh

You will be prompted for:

  • Password (for USER_NAME inside the container)
  • HOST_LABEL (used only for the prompt label)

Example prompt behavior:

  • If USER_NAME=user and you enter HOST_LABEL=dev
    • your prompt becomes user@dev
  1. Next time, just enter:
./enter.sh

Manual workflow

If you prefer separate steps:

./build.sh
./run.sh
./init.sh
./enter.sh

Notes:

  • init.sh installs oh-my-zsh and plugins only if missing.
  • run.sh creates the container if it does not exist, otherwise it starts it.

What is HOST_LABEL?

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@dev
  • user@wsl
  • user@server1 etc.

It does not affect Docker, networking, or anything else.


Non-interactive setup

setup.sh passes inputs to init.sh via environment variables:

  • DOCKER_ENV_PASSWORD
  • DOCKER_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.)


Entering the container

./enter.sh

This starts the container (if stopped) and opens an interactive zsh login shell.


Cleanup

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.


Notes / limitations

  • This container runs sshd by default (CMD ["/usr/sbin/sshd", "-D"]), but you do not have to use SSH.
  • Locale is set to en_US.UTF-8 only (no ko_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 Dockerfile if needed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors