Sometimes it may be necessary to extract the images from a DTR volume or from a backup of the DTR volumes. For example, this would be necessary in the case of a full reinstall of UCP from scratch when there is an attached DTR cluster, since the user permission information for DTR images and repositories would be lost without restoring from a UCP backup or anytime you need to retrieve all images from a DTR cluster when it isn't possible to pull the images directly.
In the absence of a functioning DTR cluster, it's possible to extract these images using the open source
Before performing these steps, you must meet the following requirements:
- Ensure you have a recent backup or copy of the dtr-registry volume
- First, identify the dtr-registry volume that needs to be extracted:
# docker volume ls --filter=name=dtr DRIVER VOLUME NAME local dtr-ca-a2382528a00b local dtr-postgres-a2382528a00b local dtr-registry-a2382528a00b local dtr-rethink-a2382528a00b
- Next, navigate to the
/var/lib/docker/volumesdirectory and copy the contents of the volume to a known location for easy access.
# cd /var/lib/docker/volumes/ # cp -r dtr-registry-a2382528a00b/ /backup-directory/.
- Next, create a Docker volume to hold the image data. In this example, a volume called
# docker volume create registry
- Next, copy the image data from the DTR volume into the volume just created:
# cp -r /backup-directory/dtr-registry-a2382528a00b/_data/ /var/lib/docker/volumes/registry/
- Now perform a quick check to ensure that the repositories are in place:
# tree -L 6 /var/lib/docker/volumes/registry registry └── _data └── docker └── registry └── v2 ├── blobs │ └── sha256 └── repositories └── mike
- Next, start up a container using the
registry:2image provided by Docker, and mount the named volume created in the container at
# docker run -v registry:/var/lib/registry -d -p 5000:5000 --name registry registry:2
- Now attempt to pull an image from the registry:
# docker pull localhost:5000/mike/minecraft Using default tag: latest latest: Pulling from mike/minecraft Digest: sha256:f3c567d7a45bd7ef4ef442ec18842f05c056943662d70c3100fa032253fd3c84 Status: Image is up to date for localhost:5000/mike/minecraft:latest