Skip to content

Instantly share code, notes, and snippets.

@branneman branneman/
Last active Apr 23, 2019

What would you like to do?
Run Debian as docker container

Run Debian as docker container


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 | bash


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
You can’t perform that action at this time.