Skip to content

Instantly share code, notes, and snippets.

@john-theo
Last active July 2, 2020 20:19
Show Gist options
  • Select an option

  • Save john-theo/3960625a196804ef2aac11161a4baf89 to your computer and use it in GitHub Desktop.

Select an option

Save john-theo/3960625a196804ef2aac11161a4baf89 to your computer and use it in GitHub Desktop.
# Specify hostname (-h <hostname>) and disable ulimit (--privileged)
docker run --rm -it -h <hostname> -p 8822:22 --privileged --name <container name> ubuntu
# Open port 8822 on the host
apt-get update
# Follow directions here to install docker
# https://docs.docker.com/engine/install/ubuntu/
apt-get install ssh
service start docker
service start ssh
adduser <user>
gpasswd -a <user> docker
# Change welcome message
figlet <message> > /etc/motd
# ----
# ssh -p 8822 <user>@<ip.of.the.host>
# docker --rm run hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment