Last active
June 17, 2016 15:44
-
-
Save jbryson3/fe90be5857ba31cac05cad9cfd17c6e2 to your computer and use it in GitHub Desktop.
Docker Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build an image from Dockerfile in current dir | |
docker build -t image-name . | |
# List images | |
docker images | |
# List containers | |
docker ps | |
# Run a docker container from image, mount a live volume, and ssh into it | |
docker run -t -i -v /home/jbryson3/code:/home/code image-name /bin/bash | |
# Run docker container in background exposing a port | |
docker run -d -p 8002:8002 image-name | |
#################### | |
# Cleanup Commands # | |
#################### | |
# Remove exited containers (using fish shell) | |
docker rm (docker ps -f "status=exited" -q) | |
# Remove none:none images | |
docker rmi (docker images -f "dangling=true" -q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment