简体   繁体   中英

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. I want to move everything to my Mac so I don't depend on the ubuntu server. Will it work if I copy the qcow2 file from the server to my Mac?

You can export it from your ubuntu machine in two ways dependening your need.

  • docker export
  • docker save

If you want the container's file system, then use 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 save image_name > pg_container_db.tar

Any of the above two commands creates an archive on ubuntu machine. Later you can use it on mac.

Copy the above pg_container_db.tar file to mac & run below command

$ 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM