How to get output as per our format
[root@ip-172-31-94-183 ~]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
newimage latest 7b68b021455a 4 hours ago 64.2MB
rajimage latest 9a7d5e7ed5a5 5 hours ago 183MB
rajguptaaws/raji123456 latest 9a7d5e7ed5a5 5 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 ls --format '{{.ID}} , {{.Repository}}'
7b68b021455a , newimage
9a7d5e7ed5a5 , rajimage
9a7d5e7ed5a5 , rajguptaaws/raji123456
4c108a37151f , ubuntu
2c5e00d77a67 , ubuntu
[root@ip-172-31-94-183 ~]# docker image ls --format '{{.ID}} , {{.Repository}} , {{.Tag}}'
7b68b021455a , newimage , latest
9a7d5e7ed5a5 , rajimage , latest
9a7d5e7ed5a5 , rajguptaaws/raji123456 , latest
4c108a37151f , ubuntu , latest
2c5e00d77a67 , ubuntu , 14.04
[root@ip-172-31-94-183 ~]#
[root@ip-172-31-94-183 ~]# docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
newimage latest 7b68b021455a 4 hours ago 64.2MB
rajimage latest 9a7d5e7ed5a5 5 hours ago 183MB
rajguptaaws/raji123456 latest 9a7d5e7ed5a5 5 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 ls --format '{{.ID}} , {{.Repository}}'
7b68b021455a , newimage
9a7d5e7ed5a5 , rajimage
9a7d5e7ed5a5 , rajguptaaws/raji123456
4c108a37151f , ubuntu
2c5e00d77a67 , ubuntu
[root@ip-172-31-94-183 ~]# docker image ls --format '{{.ID}} , {{.Repository}} , {{.Tag}}'
7b68b021455a , newimage , latest
9a7d5e7ed5a5 , rajimage , latest
9a7d5e7ed5a5 , rajguptaaws/raji123456 , latest
4c108a37151f , ubuntu , latest
2c5e00d77a67 , ubuntu , 14.04
[root@ip-172-31-94-183 ~]#
To check the history of image
[root@ip-172-31-94-183 ~]# docker image history rajimage
IMAGE CREATED CREATED BY SIZE COMMENT
9a7d5e7ed5a5 5 hours ago 183MB Imported from -
To remove the images which are not attached with any docker container
[root@ip-172-31-94-183 ~]# docker image rm ubuntu newimage
To remove the images which are attached with any docker container forcefully
[root@ip-172-31-94-183 ~]# docker image rm -f ubuntu newimage
To get the details of image like port number any many other information
[root@ip-172-31-94-183 ~]# docker image inspect newimage
It will delete all the images
[root@ip-172-31-94-183 ~]# docker image prune
No comments:
Post a Comment