Skip to content

Instantly share code, notes, and snippets.

@gastonfig
Last active December 21, 2017 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gastonfig/9ee59dd84c1e3bd0bdbff4be353cfc58 to your computer and use it in GitHub Desktop.
Save gastonfig/9ee59dd84c1e3bd0bdbff4be353cfc58 to your computer and use it in GitHub Desktop.
# Useful Docker Container Commands
docker ps -a # list all containers
docker run -td -i --name <container_name> -p 4567:4567 <image_name> # create a running container from an image.
docker exec -it <mycontainer> /bin/bash sleep infinity # get into the container
docker stop $(docker ps -a -q) # Stop ALL containers
docker rm $(docker ps -a -q) # Delete ALL containers
# Useful Docker Image Commands
docker images -a # list all images.
docker build -t <image_name> docker/ # build the image from the dockerfile in the `docker` directory.
docker rmi $(docker images -q) # Delete ALL images
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment