This is to create a Docker local Registry - local meaning creating a Registry in your Server where you have installed Docker.Registry itself is a Container, so you have to pull that using the below command and it will start running when you give this below single command."run" will actually "Pull" the docker image and "start" it so it combines both pull and start command both.
[root@localhost ~]# docker run -d -p 5000:5000 --restart=always --name registry registry:2
16d5c9185c698929a1bc93c2763edf72ae64e403536863199c899ef52e7b8442
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry 2 c2a449c9f834 12 days ago 33.2MB
mysql latest 44a8e1a5c0b2 2 weeks ago 407MB
mysql testv1 44a8e1a5c0b2 2 weeks ago 407MB
vanithav/mysql1 testv32 44a8e1a5c0b2 2 weeks ago 407MB
vanithav/mysql testv2 44a8e1a5c0b2 2 weeks ago 407MB
vanithav/soldat/mysql1 testv32 44a8e1a5c0b2 2 weeks ago 407MB
vanithav/soldat/mysql3 testv32 44a8e1a5c0b2 2 weeks ago 407MB
ubuntu latest d355ed3537e9 2 weeks ago 119MB
localhost:5000/myfirstimage latest d355ed3537e9 2 weeks ago 119MB
busybox latest c30178c5239f 3 weeks ago 1.11MB
dockercloud/client latest a073d03b69b4 4 weeks ago 15.4MB
[root@localhost ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
16d5c9185c69 registry:2 "/entrypoint.sh /e..." 29 seconds ago Up 23 seconds 0.0.0.0:5000->5000/tcp registry
ae0f03effd02 busybox "sh" 3 hours ago Exited (130) 2 hours ago gallant_yalow
dc1934cbc2cb d355ed3537e9 "/bin/bash" 3 hours ago Exited (0) 3 hours ago vigorous_shannon
[root@localhost ~]# docker push localhost:5000/myfirstimage (myfirstimage is a tag I have given for a pulled image called ubuntu)
The push refers to a repository [localhost:5000/myfirstimage]
0566c118947e: Pushed
6f9cf951edf5: Pushed
182d2a55830d: Pushed
5a4c2c9a24fc: Pushed
cb11ba605400: Pushed
latest: digest: sha256:997ed3ab854041884fccb0751ca289b0ae34c9c6d08452aa0d7ce0c69f120769 size: 1357
[root@localhost ~]#
No comments:
Post a Comment