Thursday, 11 July 2019

Docker Command Part-7 By Raj Gupta




By default latest version of image will download from docker hub...If you want to download a specific version of image then use the below command:-

[root@ip-172-31-94-183 ~]# docker pull ubuntu:14.04
[root@ip-172-31-94-183 ~]# docker image ls
ubuntu              14.04               2c5e00d77a67        8 weeks ago         188MB

To logging into Docker hub:-

[root@ip-172-31-94-183 ~]# 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: rajguptaaws
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded


Now to push the own custom image to docker hub

[root@ip-172-31-94-183 ~]# docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
newimage            latest              7b68b021455a        3 hours ago         64.2MB
rajimage            latest              9a7d5e7ed5a5        3 hours ago         183MB
ubuntu              latest              4c108a37151f        3 weeks ago         64.2MB
ubuntu              14.04               2c5e00d77a67        8 weeks ago         188MB
[root@ip-172-31-94-183 ~]# docker image tag rajimage rajguptaaws/raji123456
[root@ip-172-31-94-183 ~]# docker image ls
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
newimage                 latest              7b68b021455a        3 hours ago         64.2MB
rajimage                 latest              9a7d5e7ed5a5        3 hours ago         183MB
rajguptaaws/raji123456   latest              9a7d5e7ed5a5        3 hours ago         183MB
ubuntu                   latest              4c108a37151f        3 weeks ago         64.2MB
ubuntu                   14.04               2c5e00d77a67        8 weeks ago         188MB
[root@ip-172-31-94-183 ~]# docker push rajguptaaws/raji123456
The push refers to repository [docker.io/rajguptaaws/raji123456]
9079d3f9c52e: Pushed
latest: digest: sha256:790db81f22c4daa322fc1275ef948434290c00a8b7aaa0a449e36ee8a77c2194 size: 528



No comments:

Post a Comment