Ubuntu install Docker
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu install Docker相关的知识,希望对你有一定的参考价值。
首先需要说明的是,根据Docker的官方文档,Docker的安装必须在64位的机子上。这里只说明Ubuntu 14.04与16.04,我成功安装成功过Ubuntu 14.04,16.04还没有测试过,若为Ubuntu 12.04参考官方文档。
官方文档地址:https://docs.docker.com/engine/installation/linux/ubuntulinux/
建议先按照官方文档步骤安装,若读不懂可以参考我写的,有问题请给我留言
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------我是美丽的分割线----------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.#检查内核是否3.10以上,Docker最好的运行的环境为3.10以上,通过下面的命令查看
$ uname -r
3.11.0-15-generic
2.#Update apt sources.
$ sudo apt-get update
3.#Update package information, ensure that APT works with the https
method, and that CA certificates are installed.
$ sudo apt-get install apt-transport-https ca-certificates
4.#Add the new GPG
key
$ sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
5.#如果为ubuntu 14.04
$ echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
#如果为ubuntu 16.04
$ echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
6.#Update the APT
package index
$ sudo apt-get update
7.#Update your package manager
$ sudo apt-get update
8.#Update your package manager
$ sudo apt-get update
9.#Install the recommended packages
$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
10.#Update your APT
package index
$ sudo apt-get update
11.#Install Docker
$ sudo apt-get install docker-engine
12.#Start the docker
daemon
$ sudo service docker start
13.#Verify docker
is installed correctly
$ sudo docker run hello-world
总结:读懂英文文档很重要,安装软件特别需要读懂英文文档,有问题就Google,百度这方面有点弱,Google上的也是英文O(∩_∩)O哈哈哈~
以上是关于Ubuntu install Docker的主要内容,如果未能解决你的问题,请参考以下文章
Ubuntu Server 21.04 Install 二进制 Install docker&docker-compose
Ubuntu Server 21.04 Install 二进制 Install docker&docker-compose
How to install Docker on Ubuntu
How To Install Docker On Ubuntu 18.04