ubuntu16.04 在线安装docker ce

 
ubuntu创建普通用户:
adduser dk001

给该用户添加sudo权限:

sudo cat /etc/sudoers
增加: aeotrade ALL=(ALL:ALL) ALL

1.首先打开终端窗口输入命令,更新包信息:

$ sudo apt-get update

2. 安装CA证书,支持Https:

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

3.添加一个官方的GPG密钥:

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

4.验证密钥

$ sudo apt-key fingerprint 0EBFCD88

输出的是:9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88  即正确。

5.下载amd64的官方最新稳定版Docker:
$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
6.再次更新包信息:
$ sudo apt-get update 
7.安装Docker CE版本:-- PS: 也可以安装指定版本的docker ce 这里省略。
$ sudo apt-get install docker-ce

安装完成后,我们会发现对某个容器进行操作的时候 需要使用 加sudo 才能操作 ,这样操作起来就很繁琐 ,如何解决呢

操作步骤如下
1.创建docker组:sudo groupadd docker
2.将当前用户加入docker组:sudo gpasswd -a ${USER} docker   ---不要有疑问,就是左侧命令直接在当前用户下执行
3.重启服务:sudo service docker restart
4.刷新docker成员:newgrp - docker
【注】:在ubuntu下亲测,其他linux可能步骤稍有区别。
 

转载于:https://www.cnblogs.com/hellojesson/p/10613684.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值