Skip to content

Instantly share code, notes, and snippets.

@maurodelazeri
Forked from istepaniuk/docker.md
Created April 1, 2017 15:37
Show Gist options
  • Select an option

  • Save maurodelazeri/4ff3de1c9214e0812251b0b39af2e210 to your computer and use it in GitHub Desktop.

Select an option

Save maurodelazeri/4ff3de1c9214e0812251b0b39af2e210 to your computer and use it in GitHub Desktop.
Docker command line cheatsheet

Docker cheatsheet

Run a new container in the foregrond

docker run -ti image

Stop, delete all docker containers

docker stop $(docker ps -a -q)

docker rm $(docker ps -a -q)

Exec bash inside a running container

docker exec -ti CONTAINER_ID bash

Exec bash inside the last run container

docker exec -ti $(docker ps -q |head -n1) bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment