(转)Ubuntu 14.04 安装Docker

2020-04-02  本文已影响0人  加菲猫Jack

检查Ubuntu的内核版本

uname -r

3.13.0-55-generic

要在Ubuntu 14.04 x64安装Docker,需要确保Ubuntu的版本是64位,而且内核版本需大于3.10版。

如果Ubuntu的版本不满足,还需升级Ubuntu

sudo apt-get -y upgrade

更新apt包目录
$ sudo apt-get update

安装https支持
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

添加Docker的官方GPG Key
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

验证密钥
$ sudo apt-key fingerprint 0EBFCD88

添加Docker的apt安装源
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu(lsb_release -cs) stable"

安装Docker
sudo apt-get update sudo apt-get -y install docker-ce

测试是否安装成功
$ sudo docker run hello-world

查看Docker版本
$ sudo docker version

将用户添加到docker用户组就不用每次都 sudo了。

首先创建用户组
sudo groupadd docker
将用户加如组
sudo gpasswd -a ${USER} docker
重启服务
sudo service docker restart
切换当前会话到新组
newgrp - docker

参考:

https://blog.csdn.net/gatieme/article/details/78177983

https://blog.csdn.net/qq_34160679/article/details/89599320

https://blog.csdn.net/gatieme/article/details/78177983

https://blog.csdn.net/ycx901221/article/details/79936035

上一篇下一篇

猜你喜欢

热点阅读