2

After pulling image, for example ubuntu, how can I locate the image file on local disk.

$ docker pull ubuntu

Will the image work if I copy the image file to another machine?

OS: macOS

GoingMyWay
  • 16,802
  • 32
  • 96
  • 149
  • It's stored somewhere inside /var/lib/docker, and copying it is discouraged. What are you trying to do? – Tatsuyuki Ishi Apr 02 '17 at 13:55
  • @TatsuyukiIshi, since the pulling process is slow, so I wanna pull the image and copy the image file to another machine, it 's `docker pull quay.io/openai/universe.flashgames:0.20.2` – GoingMyWay Apr 02 '17 at 13:57

1 Answers1

6

If your Aim is to copy any image from one machine to other.

execute the following in the machine where the images are present

docker save -o <save image to path> <image name>

Then copy your image files to the other machine using any regular file transfer tools such as cp or scp. Then execute the following command there

docker load -i <path to image tar file>
shahin
  • 3,515
  • 1
  • 17
  • 17