ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Docker下安装ubuntu

Docker下安装ubuntu

原创 Linux操作系统 作者:甲骨文技术支持 时间:2018-01-10 14:42:35 0 删除 编辑
安装ubuntu,很简单,用pull命令即可
  1. [root@ip-172-31-29-22 ~]# docker pull ubuntu
  2. Using default tag: latest
  3. latest: Pulling from library/ubuntu
  4. 50aff78429b1: Pull complete
  5. f6d82e297bce: Pull complete
  6. 275abb2c8a6f: Pull complete
  7. 9f15a39356d6: Pull complete
  8. fc0342a94c89: Pull complete
  9. Digest: sha256:fbaf303d18563e57a3c1a0005356ad102509b60884f3aa89ef9a90c0ea5d1212
  10. Status: Downloaded newer image for ubuntu:latest
  1. 查看images

    1. [root@ip-172-31-29-22 ~]# docker images
    2. REPOSITORY TAG IMAGE ID CREATED SIZE
    3. ubuntu latest 00fd29ccc6f1 3 weeks ago 111MB

 默认安装的都是最新版,如果想安装自己想要的版本需要具体给出,如下:

  1. [root@ip-172-31-29-22 ~]# docker pull ubuntu:14.04
  2. 14.04: Pulling from library/ubuntu
  3. 050aa9ae81a9: Pull complete
  4. 1eb2c989bc04: Pull complete
  5. f5e83780ccda: Pull complete
  6. 2dec31d7323c: Pull complete
  7. 286f32949bdc: Pull complete
  8. Digest: sha256:084989eb923bd86dbf7e706d464cf3587274a826b484f75b69468c19f8ae354c
  9. Status: Downloaded newer image for ubuntu:14.04
  1. 查看images
  1. [root@ip-172-31-29-22 ~]# docker images;
  2. REPOSITORY TAG IMAGE ID CREATED SIZE
  3. ubuntu latest 00fd29ccc6f1 3 weeks ago 111MB
  4. ubuntu 14.04 67759a80360c 3 weeks ago 221MB
  5. mysql 5.5.40 663a514cfc40 3 years ago 215MB
刚我又安装了一个mysql5.5.40,删除它

  1. [root@ip-172-31-29-22 ~]# docker rmi mysql:5.5.40
运行刚才安装好的ubuntu,看版本是14.04
  1. [root@ip-172-31-29-22 ~]# docker run -i -t ubuntu:14.04 /bin/bash
  2. root@3715e8a8b25b:/#
  3. root@3715e8a8b25b:/# cat /etc/issue
  4. Ubuntu 14.04.5 LTS \n \l

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20893244/viewspace-2149982/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: RedHat 7.4安装Docker
请登录后发表评论 登录
全部评论
2009年获得Oracle OCM认证,ITPUB社区OCM联盟成员,熟悉Oracle,mysql,Python,Zabbix等。

注册时间:2016-12-31

  • 博文量
    143
  • 访问量
    570501