Bootstrap

Ubuntu apt-get安装docker

  • Docker 支持以下的 Ubuntu 版本

    • Ubuntu Precise 12.04 (LTS)

    • Ubuntu Trusty 14.04 (LTS)

    • Ubuntu Wily 15.10

    • 其他更新的版本……

  • 前提条件

    • Docker 要求 Ubuntu 系统的内核版本y因高于 3.10

  • 使用apt-get安装docker

    • 通过 uname -r 命令查看你当前的内核版本,以确认Ubuntu版本是否支持docker。

    • uname -r

    • 查看内核

    • 更新安装包,以确保获取到最新版本的docker安装包

    • apt-get update -y

    • 更新安装包

    • 使用命令安装docker

    • apt-get -y install docker.io

    • 安装docker

    • 启动docker并设置开机自启

    • systemctl start docker && systemctl enable docker

    • 启动docker

    • 测试hello-world,以验证docker是否安装成功并在容器中执行应该测试的镜像

    • docker run hello-world

      • 由于本地没有hello-world这个镜像,所以会下载一个hello-world的镜像,并在容器内运行。
    • hello-world

  • 到此,docker 在 Ubuntu系统的安装完成。

;