简体   繁体   English

我可以将docker qcow2文件从ubuntu服务器复制到我的mac吗?

[英]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计算机中将其导出,具体取决于您的需求。

  • docker export 码头工人出口
  • docker save 码头工人保存

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.

相关问题 我可以复制文件,但不能从Mac终端移动文件 - I can copy file but can not move it from my Mac Terminal QEMU .qcow2 mmu_gva_to_gpa 在 Mac OS X 中崩溃 - QEMU .qcow2 mmu_gva_to_gpa crash in Mac OS X 如何从Mac中的Docker容器外部访问? - How can I access from outside my docker container in mac? 在我运行 docker compose up 后,我的 mac 返回错误,指出它找不到我的 mix phx.server。 如何向 docker 显示我的 mix.exs 文件在哪里? - After I run docker compose up, my mac returns error stating that it can't find my mix phx.server. How do I show docker where my mix.exs file is? 如何从Mac的Redis Desktop Manager连接到Docker容器中的Redis服务器? - How can I connect to Redis server in a Docker Container from Redis Desktop Manager in Mac? 如何将文件夹从Ubuntu复制到Mac - How to copy folder from Ubuntu to mac 尝试将文件从本地 Mac 上传到远程 Ubuntu 服务器 - Trying to upload a file from local Mac to remote Ubuntu server 你如何解决Docker for Mac中Docker.qcow2的大小限制? - How do you get around the size limitation of Docker.qcow2 in the Docker for Mac? 我需要从服务器A复制一个文件,该文件只能先连接到服务器B才能访问 - I need to copy a file from server A that I can only access by first connecting to server B 如何将我的Go程序从Mac OS X交叉编译为Ubuntu 64位 - How do I cross compile my Go program from Mac OS X to Ubuntu 64-bit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM