Docker 101 : Docker Registry



The docker registry is a program that you can also run on your machine.
Its role is storing docker images and their metadata ( tags, ... ).

The docker registry is also a service that opens port 5000 for incoming queries, like pushing, pulling or loading a docker image.
It can also authenticates users.


Running a registry service:

We run the registry image using the below command:


-p : for publishing the ports,  it  maps port 5000 of the host to port 5000 on the container.
-d : for the detached mode. The container will run in the background.
--restart: when it is set to "always", the container is restarted 
if it crashes.

Pushing an image to our registry:

We first tag our "debian" image:


Then we push it onto the registry on our localhost:


Saving images locally:

To save our image locally, we use the below command:


-o: tells docker to save the image "debian:12" into the "saved-images.tar.gz" file.

The saved images could also be easily moved to a different machine or to a different cluster.

Removing and restoring our image:

We can remove our image "debian:12" using the below command:


Then we could restore it using the "load" command as below:


-i: stands for the input file from which we load our image.

Comments

Leave as a comment:

Archive