Skip to content

Publish an image

Once an image is built, it is possible to push it to a registry like for example dockerhub to share it publicly.

Dockerhub registry

To publish on dokerhub registry, you need to create an account.

user@host $ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don t have a Docker ID, head over to https://hub.docker.com to create one.
Username: your_login
Password:
WARNING! Your password will be stored unencrypted in /home/user/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
user@host $ docker image push mypython:test
user@host $ docker image push mypython

Then check on the dockerhub website if the images have been published.

Gitlab registry

Each project on the IN2P3 Gitlab server is able to store Docker images. On the server website, the Registry tab of each project lists the stored images, as well as instructions for downloading or uploading them; for instance:

user@host $ docker login gitlab-registry.in2p3.fr
Username: your_login
Password:
WARNING! Your password will be stored unencrypted in /home/abaillyr/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
user@host $ docker build -t gitlab-registry.in2p3.fr/abaillyr/myproject/my_image:v1 project_app/
user@host $ docker push gitlab-registry.in2p3.fr/abaillyr/myproject/my_image:v1

Tip

You can also use continuous integration to allow automatic building of a Docker image accessible via the GitLab registry.