Difference between revisions of "Docker goodies"

From BITPlan profiwiki Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
=== Copy a file from a container to the host system ===
 
=== Copy a file from a container to the host system ===
 
* http://stackoverflow.com/a/22050116/1497139
 
* http://stackoverflow.com/a/22050116/1497139
* docker cp <containerId>:/file/path/within/container /host/path/target
+
<source lang='bash'>
 +
docker cp <containerId>:/file/path/within/container /host/path/target
 +
</source>
  
 
=== Attach to a running container ===
 
=== Attach to a running container ===

Revision as of 05:17, 23 October 2015

Copy a file from a container to the host system

docker cp <containerId>:/file/path/within/container /host/path/target

Attach to a running container

docker exec -it $containername /bin/bash

Remove untagged docker images

http://stackoverflow.com/a/28377696/1497139

docker rmi -f $(docker images -f "dangling=true" -q)

Support for build env variables

Upcoming feature in 1.9?