In this post, I will give you an example for what I do to push a docker container into docker hub.
Here I will use my repository in docker hub i.e. arwankhoiruddin/hadoopbuild
. You can find it here: https://hub.docker.com/r/arwankhoiruddin/hadoopbuild/
In order to modify it, first I have to login
$ 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 (arwankhoiruddin): arwankhoiruddin
Password:
Login Succeeded
Then I run the docker image
$ docker run -it arwankhoiruddin/hadoopbuild /bin/bash
If it is not in my computer, it will download automatically from docker hub. After I finish, I type exit
and I can save the changes into the docker hub. Followings are the steps
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
856e27749098 ubuntu:14.04 "/bin/bash" About an hour ago Exited (0) About an hour ago awesome_aryabhata
Then commit the changes
$ docker commit 856e27749098 arwankhoiruddin/hadoopbuild
Tag the image
$ docker tag arwankhoiruddin/hadoopbuild latest
Push the image
$ docker push arwankhoiruddin/hadoopbuild
The push refers to repository [docker.io/arwankhoiruddin/hadoopbuild]
eed11865a805: Pushing [=> ] 19.82MB/959.3MB
776d5289b76e: Layer already exists
0fb55a72eab2: Layer already exists
a30ab2bcda94: Layer already exists
99840408c5ea: Layer already exists
a8e78858b03b: Layer already exists
Done
Comments