Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. First, find the container's name or ID:
  2.  
  3. $ docker ps
  4. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  5. b9b7400ddd8f ubuntu:latest "/bin/bash" 2 seconds ago Up 2 seconds elated_hodgkin
  6. In the example above we can either use b9b7400ddd8f or elated_hodgkin.
  7.  
  8. If you wanted to copy everything in /tmp/somefiles on the host to /var/www in the container:
  9.  
  10. $ cd /tmp/somefiles
  11. $ tar -cv * | docker exec -i elated_hodgkin tar x -C /var/www
  12. We can then exec /bin/bash in the container and verify it worked:
  13.  
  14. $ docker exec -it elated_hodgkin /bin/bash
  15. root@b9b7400ddd8f:/# ls /var/www
  16. file1 file2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement