This the multi-page printable view of this section.Click here to print.

Return to the regular view of this page.

Mirroring an Image

How to mirror an image to a local docker repository

Table of Contents

To mirror an image simply run the command

1docker-mirror -d docker.example.com golang:alpine

Where docker.example.com is the url to your local repository and golang:alpine is the image you want to mirror.

Once complete your mirror of the image can be retrieved with the tag docker.example.com/library/golang:alpine

Note about libraries

In the above example the golang:alpine image is pushed as library/golang:alpine. This is because in docker the source image is in the library project, so if an image does not contain a project then it gets the library project inserted during the pull.

If you pulled from a different project then you would get a path you would expect.

For example, mirroring area51/example:latest would mirror it as docker.example.com/area51/example:latest

Flowchart of mirror process
Flow chart showing what docker-mirror does to perform the mirror