Store build in Docker Hub

References

http://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html

Introduction

Once generated a docker image, it can be store in Docker Hub.

For Docker Hub sign-up, a free account can be created at:

https://hub.docker.com/

Log into Docker Hub from command line

$ docker login --username=josemanuelrodriguez
Password:
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: TLS handshake timeout

Issue solved, thanks to https://github.com/moby/moby/issues/22635#issuecomment-224708869

sudo sysctl -w net.ipv4.tcp_mtu_probing=1

and adding the following line to /etc/sysctl.conf:

net.ipv4.tcp_mtu_probing=1 
$ docker login --username=josemanuelrodriguez
Password:
Login Succeeded

Create a docker image tag

Let's create a tag of the image to be pushed to Docker Hub (see docker images to find out the tag name)

Syntax: docker tag bb38976d03cf yourhubusername/yourhubrepo:tagname

$ docker tag eb8487a11e20 josemanuelrodriguez/jenkins-openshift:v1.0.0

Store docker image in Docker Hub

docker push josemanuelrodriguez/jenkins-openshift
The push refers to a repository [docker.io/josemanuelrodriguez/jenkins-openshift]
3427fe968205: Pushed
20f314f97125: Pushed
fbba8cb56cea: Pushing [==>                                                ]  3.898MB/92.51MB
ea192f954d8f: Pushing [==>                                                ]    919kB/20.93MB
f55aea053790: Pushing [==>                                                ]  1.147MB/20.93MB
4db8cc51996d: Pushing  8.704kB
c4d771bb36ef: Pushing [========>                                          ]  523.3kB/2.985MB
9b22077db44b: Waiting
a216b8bd2a10: Waiting
bd97d2b42fe5: Waiting
8cb1f88fdeab: Waiting
...