Skip to content

Instantly share code, notes, and snippets.

@branneman
Last active April 23, 2019 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save branneman/e0001aa89a018f8df360908288883dc2 to your computer and use it in GitHub Desktop.
Save branneman/e0001aa89a018f8df360908288883dc2 to your computer and use it in GitHub Desktop.
Run Debian as docker container

Run Debian as docker container

Setup

Start a container in detached mode:

docker run -dit --name deb -e "LANG=C.UTF-8" -w "/root" debian:latest bash

Connect to it and do initial setup:

docker exec -it deb bash
echo "debconf debconf/frontend select Noninteractive" | debconf-set-selections
apt update && apt upgrade -y

apt install -y locales
rm -rf /var/lib/apt/lists/* && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

apt install -y curl
curl -L bit.ly/branneman-dotfiles | bash

exit

Run shell in container

If the container is not running, run docker start deb first. Then connect to the container with:

docker exec -it deb bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment