How to install Docker on Ubuntu

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了How to install Docker on Ubuntu相关的知识,希望对你有一定的参考价值。

Docker currently only runs on 64-bits platforms and requires that the kernal version be no less than 3.10.
in this tutorial , i use ubuntu 16.04 and the kernal version is 4.13.0-43-generic
you can use this command to find your linux-version and linux-kernal version.

uname -a 
cat /proc/version

At the first , you need to update your existing list of packages:

sudo apt update

Second, you need to install a few prerequisite packages which let apt use packages over HTTPS

sudo apt install apt-transport-https ca-certificates curl software-properties-common

add the GPG key for the official Docker repository to your system:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Add the Docker repository to APT sources:

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

update the package database with the Docker packages from the newly added repo:

sudo apt-get update

After you can install Docker

sudo  apt-get install docker-ce

if you have error on apt-get like this :
技术分享图片
you can use this command to find the process using apt , and kill it !

ps aux | grep apt

技术分享图片
after that , how can you check that docker is installed ?
you can use this command to chek

sudo service docker start 
docker version

技术分享图片

Reference:
https://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process

以上是关于How to install Docker on Ubuntu的主要内容,如果未能解决你的问题,请参考以下文章

sh 来自https://www.digitalocean.com/community/tutorials/how-to-install-docker-compose-on-ubuntu-16-04

How to install VNC server on CentOS 6

How to install Wine on Ubuntu Linux 64bit

How to Install Oracle JAVA 8 on Debian 9 / Debian 8

How to Install PhantomJS on Ubuntu 16.04

How to Install Nginx with PHP + MySQL (LEMP) on Debian 9