Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Last active August 4, 2016 22:51
Show Gist options
  • Save darth-veitcher/68de0a7b12a772791a88 to your computer and use it in GitHub Desktop.
Save darth-veitcher/68de0a7b12a772791a88 to your computer and use it in GitHub Desktop.
Useful Docker hacks
# Connect to shell on container with ability to exit out again
docker exec -ti <containerId> bash
# Copy from container out to host
docker cp <containerId>:/file/path/within/container /host/path/target
# Remove all Stopped containers
# -f is the filter flag
docker rm $(docker ps -aqf status=exited)
# Mount a shared filesystem
docker run -v /path/to/hostdir:/mnt <containerId>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment