Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Docker卷投资主机到机器_Docker - Fatal编程技术网

Docker卷投资主机到机器

Docker卷投资主机到机器,docker,Docker,如何复制容器中的文件以便编辑它们 服务: 网状物: 图片:jitsi/web 重新启动:${restart_POLICY} 端口: -“${HTTP_PORT}:80” -“${HTTPS_PORT}:443” 卷数: -${CONFIG}/web:/CONFIG -${CONFIG}/web/letsencrypt:/etc/letsencrypt -${CONFIG}/transcripts:/usr/share/jitsi meet/transcripts 我想访问容器中目录/usr/s

如何复制容器中的文件以便编辑它们

服务:
网状物:
图片:jitsi/web
重新启动:${restart_POLICY}
端口:
-“${HTTP_PORT}:80”
-“${HTTPS_PORT}:443”
卷数:
-${CONFIG}/web:/CONFIG
-${CONFIG}/web/letsencrypt:/etc/letsencrypt
-${CONFIG}/transcripts:/usr/share/jitsi meet/transcripts
我想访问容器中目录
/usr/share/jitsi meet/transcripts
中的文件:

base.html  connection_optimization  favicon.ico  head.html  index.htmllibs  package-lock.json  plugin.head.html  scripts  static      transcripts
root@cb7d87c5635f:/usr/share/jitsi-meet#
您可以使用以下命令:

sudo docker cp:/path/in/container/path/in/host/
使用相同的命令,您可以将文件从主机向后复制到Docker容器。

您可以使用以下命令:

sudo docker cp:/path/in/container/path/in/host/

使用相同的命令,您可以将文件从主机向后复制到Docker容器。

将其作为卷装载。为了编辑它并查看容器中的更改,我不确定这在运行时是否可行。为什么不将文件复制到主机上,然后编辑它并将其复制回Docker容器?我在这里还发现了一个讨论——也是一个复杂的方法——我希望这对您有所帮助。将其作为卷装载。为了编辑它并查看容器中的更改,我不确定这在运行时是否可行。为什么不将文件复制到主机上,然后编辑它并将其复制回Docker容器?我在这里还发现了一个讨论——一种复杂的方式——我希望这对您有所帮助。
sudo docker cp <containerId>:/path/in/container /path/in/host/