Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First, find the container's name or ID:
- $ docker ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- b9b7400ddd8f ubuntu:latest "/bin/bash" 2 seconds ago Up 2 seconds elated_hodgkin
- In the example above we can either use b9b7400ddd8f or elated_hodgkin.
- If you wanted to copy everything in /tmp/somefiles on the host to /var/www in the container:
- $ cd /tmp/somefiles
- $ tar -cv * | docker exec -i elated_hodgkin tar x -C /var/www
- We can then exec /bin/bash in the container and verify it worked:
- $ docker exec -it elated_hodgkin /bin/bash
- root@b9b7400ddd8f:/# ls /var/www
- file1 file2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement