docker 从容器中向主机拷贝数据:
sudo docker cp <containerId>:/file/path/within/container /host/path/target
/file/path/within/container : 容器里面的目录
/host/path/target : 主机目录
sudo docker cp 88fc08c48349:/opt/apache-tomcat-8.0.41/logs /opt/logs/
-----------------------------华丽分割线--------------------------------
从主机复制到容器:sudo docker cp host_path containerID:container_path
时间: 2024-10-06 18:11:08