2

There are several questions regarding how to view docker images on local machine including I can't find my Docker image after building it

The docker images command does report that an image was successfully created:

$docker images

REPOSITORY                                              TAG                 IMAGE ID            CREATED             SIZE
caffeonspark                                            cpu                 bd347271dc01        28 minutes ago      5.28 GB

This question is about the physical locations of the docker files - to do operations like copying/backups etc. How would the paths be found on OS/X?

Community
  • 1
  • 1
WestCoastProjects
  • 58,982
  • 91
  • 316
  • 560

1 Answers1

1

On Mac, Docker images are stored within the VM. See this Question.

On Linux, Docker images are stored in /var/lib/docker, so backing up that directory should be sufficient.

I don't think you should be copying images from that directory. The normal way to share a built image between machines is with Docker Hub or with a private Docker registry. If you want to share images that are not published to a registry, you can simply share the Dockerfile.

Community
  • 1
  • 1
mkasberg
  • 16,022
  • 3
  • 42
  • 46
  • Docker mounts a containers view of it's file system inside /var/lib/docker too so when backing up you don't want to cross to new file systems otherwise you will be backing up duplicate data. – Matt Jan 31 '17 at 23:16