Skip to content

Instantly share code, notes, and snippets.

@andypotanin
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save andypotanin/8f1cedc571dfd204c43e to your computer and use it in GitHub Desktop.

Select an option

Save andypotanin/8f1cedc571dfd204c43e to your computer and use it in GitHub Desktop.
# docker run --rm centos /bin/sh
# Will start you into shell, and continue running after you exit.
docker run --name=App1 -t centos /bin/sh
# Won't do anything because no terminal tag.
docker run --name=App2 centos /bin/sh
# Will start and persist w/o loading you into shell.
docker run --name=App3 -td centos /bin/sh
docker run --name=App4 -td centos /bin/sh
# Won't do anything, must run /bin/sh
docker run --name=App5 -td centos pwd
# Won't do anything, must run /bin/sh
docker run --name=App6 -t centos /bin/sh mkdir "test" && ls
# Will output LS and then start your bash
docker run --name=App9 -t --rm centos ls && /bin/sh
# docker run --name=App11 -t centos /bin/bash <(curl -s https://gist.githubusercontent.com/andypotanin/cce9e3b5f21c3eab6173/raw/)
# docker run --name=App12 -t centos wget -O - https://gist.githubusercontent.com/andypotanin/cce9e3b5f21c3eab6173/raw/ | /bin/bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment