Skip to content

Instantly share code, notes, and snippets.

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

  • Save aaronlelevier/164866f18b81f65499b9 to your computer and use it in GitHub Desktop.

Select an option

Save aaronlelevier/164866f18b81f65499b9 to your computer and use it in GitHub Desktop.
Docker Cheatsheet

Docker Command Line Cheatsheet

# Build image
# -t : tag
# . : current dir
docker build -t username/image_name:tag_name .

# start image in bash
# -i : interactive
# -t : terminal
docker run -i -t ubuntu /bin/bash

# Delete "<none>" tagged images
docker images | grep "<none>" | awk '{print $3}' | xargs docker rmi -f

# list all containers that have been executed
# -a : all
# get the container_id from here in order to commit the correct container
docker ps -a

# commit image locally
docker commit container_id image_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment