14.04.1-Ubuntu下Docker安装

    xiaoxiao2021-03-25  98

    Docker 支持这些 Ubuntu 操作系统:

    Ubuntu Wily 15.10 Ubuntu Vivid 15.04 Ubuntu Trusty 14.04 (LTS) Ubuntu Precise 12.04 (LTS)

    本页指导您使用 Docker-managed 管理发行包和安装机制来安装。使用这些安装包可以确保你获取到的是最新发布的Docker。如果你希望使用 Ubuntu-managed 包安装,查阅ubuntu相关文档。 执行下面命令查看对应版本:

    lsb_release -cs

    查看系统版本:

    yanchao@yanchao-PowerEdge-R720:~$ uname -a Linux yanchao-PowerEdge-R720 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux yanchao@yanchao-PowerEdge-R720:~$

    更新 apt 源 1.打开命令行执行以下命令(增加新 gpg key):

    $ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

    2.在编辑器中打开编辑这个 /etc/apt/sources.list.d/docker.list 文件。如果文件不存在,新建。删除所有存在的项。 在文件中新增以下内容:

    deb https://apt.dockerproject.org/repo ubuntu-precise main deb https://apt.dockerproject.org/repo ubuntu-trusty main deb https://apt.dockerproject.org/repo ubuntu-precise main deb https://apt.dockerproject.org/repo ubuntu-vivid main deb https://apt.dockerproject.org/repo ubuntu-wily main

    3.更新apt软件包索引:

    $ apt-get update

    4.清除旧仓库如果存在。

    $ apt-get purge lxc-docker

    5.验证 apt 是从 右库来拉取软件包。

    $ apt-cache policy docker-engine

    从现在开始当使用 apt-get 升级,apt 将会从新的仓库拉取软件包。


    安装 确保已经安装了前提的 Ubuntu 版本,接下来, 根据下面步骤安装 Docker: 1.使用sudo 权限的用户登录到Ubuntu系统进行安装。 2.更新 apt 软件包索引。

    $ sudo apt-get install docker-engine

    3.安装 Docker.

    $ sudo apt-get install docker-engine

    4.Start the docker daemon.

    $ sudo service docker start

    5.Verify docker is installed correctly.

    $ sudo docker run hello-world

    This command downloads a test image and runs it in a container. When the container runs, it prints an informational message. Then, it exits.


    6.执行以下命令查看安装的Docker版本.

    $ docker version

    参考博客:https://my.oschina.net/Rayn/blog/547134 Docker中文网:http://www.docker.org.cn/book/docker/prepare-docker-5.html

    转载请注明原文地址: https://ju.6miu.com/read-21415.html

    最新回复(0)