Last active
August 4, 2016 22:51
-
-
Save darth-veitcher/68de0a7b12a772791a88 to your computer and use it in GitHub Desktop.
Useful Docker hacks
This file contains hidden or 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
| # 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