Copy a Docker image from one registry to another

|
Tags:  Docker

Copying docker images is useful to prevent losing access to an image if the remote registry goes down or to move images between environments (For example: from testing to production)

The process consists in pulling an image from an origin repository, change the tag, and push the image to a remote repository.

Example:

# Login to docker registries
docker login registry-testing.thingsandcode.com -u=Branyac -p=FakePassw0rd
docker login registry-production.thingsandcode.com -u=Branyac -p=FakePassw0rd

# Pull source image
docker pull registry-testing.thingsandcode.com/thingsandcode-web:20220830-test

# Change tag to match the desired tag for the remote registry
docker tag registry-testing.thingsandcode.com/thingsandcode-web:20220830-test registry-production.thingsandcode.com/thingsandcode-web:20220830-pro

# Upload image to the remote registry
docker push registry-production.thingsandcode.com/thingsandcode-web:20220830-pro

Author

Sergio Monedero

I am excited to share my knowledge and insights on programming and devops through this personal website. I am a lifelong learner with a passion for technology, and I enjoy staying up-to-date on the latest industry trends.


Keep in touch with Me: SergioCoder@LinkedIn | Branyac@Github