[英]Can I copy the docker qcow2 file from an ubuntu server to my mac?
I have an ubuntu server where I installed docker to run some containers. 我有一个ubuntu服务器,我在其中安装了docker来运行一些容器。 I want to move everything to my Mac so I don't depend on the ubuntu server. 我想将所有内容移至Mac,因此我不依赖ubuntu服务器。 Will it work if I copy the qcow2 file from the server to my Mac? 如果将qcow2文件从服务器复制到Mac,是否可以使用?
You can export it from your ubuntu machine in two ways dependening your need. 您可以通过两种方式从ubuntu计算机中将其导出,具体取决于您的需求。
If you want the container's file system, then use docker export
如果您想要容器的文件系统,请使用docker export
$ docker export container_name > pg_container_db.tar
If you just want your image file system, use below command instead of docker export
如果您只想要图像文件系统,请使用以下命令代替docker export
$ docker save image_name > pg_container_db.tar
Any of the above two commands creates an archive on ubuntu machine. 以上两个命令中的任何一个都会在ubuntu计算机上创建一个存档。 Later you can use it on mac. 稍后,您可以在Mac上使用它。
Copy the above pg_container_db.tar
file to mac & run below command 将上面的pg_container_db.tar
文件复制到mac并运行以下命令
$ docker load < pg_container_db.tar
Once the above command is successful on you mac, you should be able to see by using docker images
command. 在Mac上成功执行上述命令后,您应该可以通过使用docker images
命令来查看。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.