将文件从主机复制到Docker容器

一笑奈何 提交于 2020-08-07 07:31:13

问题:

I am trying to build a backup and restore solution for the Docker containers that we work with. 我正在尝试为我们使用的Docker容器构建备份和还原解决方案。

I have Docker base image that I have created, ubuntu:base , and do not want have to rebuild it each time with a Docker file to add files to it. 我有我创建的Docker基本映像ubuntu:base ,并且不想每次都必须使用Docker文件重建它来向其添加文件。

I want to create a script that runs from the host machine and creates a new container using the ubuntu:base Docker image and then copies files into that container. 我想创建一个从主机运行的脚本,并使用ubuntu:base Docker映像创建一个新容器,然后将文件复制到该容器中。

How can I copy files from the host to the container? 如何将文件从主机复制到容器?


解决方案:

参考一: https://stackoom.com/question/1Y7DT/将文件从主机复制到Docker容器
参考二: https://oldbug.net/q/1Y7DT/Copying-files-from-host-to-Docker-container
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!