博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
How to install Docker on Ubuntu
阅读量:6986 次
发布时间:2019-06-27

本文共 3144 字,大约阅读时间需要 10 分钟。

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 :

How to install Docker on Ubuntu
you can use this command to find the process using apt , and kill it !

ps aux | grep apt

How to install Docker on Ubuntu

after that , how can you check that docker is installed ?
you can use this command to chek

sudo service docker start docker version

How to install Docker on Ubuntu

Than,test that your installation works by running the simple Docker image, hello-world:

root@ubuntu:~# docker run hello-worldHello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.    (amd64) 3. The Docker daemon created a new container from that image which runs the    executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it    to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://hub.docker.com/For more examples and ideas, visit: https://docs.docker.com/get-started/

List the hello-world container (spawned by the image) which exits after displaying its message. If it were still running, you would not need the --all option:

root@ubuntu:~# docker container ls --allCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES46ea9cb299d4        hello-world         "/hello"            2 minutes ago       Exited (0) 2 minutes ago                        objective_mestorf1d9c5cbbed49        hello-world         "/hello"            9 minutes ago       Exited (0) 9 minutes ago                        goofy_diffiefef4ade3de12        hello-world         "/hello"            22 minutes ago      Exited (0) 22 minutes ago                       pensive_brown6d77512305e5        hello-world         "/hello"            22 minutes ago      Exited (0) 22 minutes ago                       vigorous_heyrovsky

Reference:

转载于:https://blog.51cto.com/12098022/2294095

你可能感兴趣的文章
Apache CarbonData:大数据生态一种新的高性能数据格式
查看>>
用Docker构建⼀个区块链工作和开发环境(上)
查看>>
Macbook Pro 关闭SIP 方法
查看>>
centos下统计目录下所有文件的的个数
查看>>
(26)改变自动扫描的包【从零开始学Spring Boot】
查看>>
论Linux系统学习的奇淫异巧
查看>>
从零开始开发微信小程序(二):开发一个简单的小程序
查看>>
如何在国内愉快的安装 Kubernetes v1.6.2
查看>>
Mysql GTID 模式详解
查看>>
es6函数总结
查看>>
Nodejs--readline(逐行读取)
查看>>
QT创建与QT无关的纯C++程序和动态/静态库
查看>>
为网建公司注入专业前端力量
查看>>
Vbox下虚拟机linux系统安装tomcat
查看>>
Mysql 多表合并统计
查看>>
maven引入jar包问题导致项目无法启动,感叹号
查看>>
那些年,阿里巴巴技术男神们写的书!
查看>>
我一个理科生造的AI,怎么就去做历史高考题了呢?
查看>>
Fragment之软件主页面制作
查看>>
properties文件读写自己写的方法
查看>>