Skip to content

Instantly share code, notes, and snippets.

@willm
Last active August 29, 2015 14:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willm/6b6a6af141268a033dc7 to your computer and use it in GitHub Desktop.
Save willm/6b6a6af141268a033dc7 to your computer and use it in GitHub Desktop.
docker cheat sheet
docker build -t [TAG] .
# build an image from a Dockerfile in the current directory with the tagname.
docker create --name=[NAME] [TAG]
# create a container called [NAME] built from the image [TAG]
docker start [NAME]
# start the [NAME] container
docker ps -a
# list all (running and stopped containers)
docker rm [NAME]
# delete [NAME] container
docker exec [NAME] [COMMAND] [ARGS]
# run a command inside the container
docker inspect [NAME]
# print information about the container
docker run -t -i [IMAGE] /bin/bash
# start and run an interactive shell inside a container from the image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment