安装ubuntu,很简单,用pull命令即可
-
[root@ip-172-31-29-22 ~]# docker pull ubuntu
-
Using default tag: latest
-
latest: Pulling from library/ubuntu
-
50aff78429b1: Pull complete
-
f6d82e297bce: Pull complete
-
275abb2c8a6f: Pull complete
-
9f15a39356d6: Pull complete
-
fc0342a94c89: Pull complete
-
Digest: sha256:fbaf303d18563e57a3c1a0005356ad102509b60884f3aa89ef9a90c0ea5d1212
-
Status: Downloaded newer image for ubuntu:latest
-
查看images
-
-
-
[root@ip-172-31-29-22 ~]# docker images
-
REPOSITORY TAG IMAGE ID CREATED SIZE
-
ubuntu latest 00fd29ccc6f1 3 weeks ago 111MB
默认安装的都是最新版,如果想安装自己想要的版本需要具体给出,如下:
-
[root@ip-172-31-29-22 ~]# docker pull ubuntu:14.04
-
14.04: Pulling from library/ubuntu
-
050aa9ae81a9: Pull complete
-
1eb2c989bc04: Pull complete
-
f5e83780ccda: Pull complete
-
2dec31d7323c: Pull complete
-
286f32949bdc: Pull complete
-
Digest: sha256:084989eb923bd86dbf7e706d464cf3587274a826b484f75b69468c19f8ae354c
-
Status: Downloaded newer image for ubuntu:14.04
-
查看images
-
[root@ip-172-31-29-22 ~]# docker images;
-
REPOSITORY TAG IMAGE ID CREATED SIZE
-
ubuntu latest 00fd29ccc6f1 3 weeks ago 111MB
-
ubuntu 14.04 67759a80360c 3 weeks ago 221MB
-
mysql 5.5.40 663a514cfc40 3 years ago 215MB
刚我又安装了一个mysql5.5.40,删除它
-
[root@ip-172-31-29-22 ~]# docker rmi mysql:5.5.40
运行刚才安装好的ubuntu,看版本是14.04
-
[root@ip-172-31-29-22 ~]# docker run -i -t ubuntu:14.04 /bin/bash
-
root@3715e8a8b25b:/#
-
root@3715e8a8b25b:/# cat /etc/issue
-
Ubuntu 14.04.5 LTS \n \l
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20893244/viewspace-2149982/
,如需转载,请注明出处,否则将追究法律责任。