我可以在应用程序之间共享一个卷。
docker volume create --name hello
但是,如果我想使用主机的IDE来编辑这些数据,我怎么办?
答案 0 :(得分:1)
目前,您需要mount a host directory (as a data volume)才能直接在容器中编辑主机文件。
-v /src/webapp:/opt/webapp training/webapp python app.py
此命令将主机目录
/src/webapp
安装到/opt/webapp
的容器中。如果路径/opt/webapp
已经存在于容器的图像中,则/src/webapp
挂载会覆盖,但不会删除预先存在的内容。