Create Docker volume with preexisting data in it

丶灬走出姿态 提交于 2019-12-02 09:45:28

The short answer is no, but that's because you've gone down the wrong road with your container.

This is why your image shouldn't include static data. Keep the static things in the image, and they dynamic things in a data container. (And a startup script to dynamically evaluate anything that needs it)

You can probably use a docker cp to extract the files into a data container for a one off - or just passthrough mount a local filesystem, to a new mountpoint, and just use tar / rsync with docker exec before re-mounting - but actually I'd suggest rebuild your image to always use a data container for it's data.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!