The core foundation of Docker container file replication and mount

  • Replicated from the host to the vessel
    • docker cp /root/123.txt mycentos:/home/
  • Copy from the container to the host: docker cp container Name / ID: local host container path Path
  docker cp mycentos:/home/456.txt /root
  • Folder host to mount containers: docker run -itd -v path host: ID container path mirroring 
    docker run -itd -v /root/xdclass/:/home centos:7

     

Guess you like

Origin www.cnblogs.com/weisunblog/p/12233848.html