系统要求

  • 64位操作系统
  • Linux kernel大于等于3.10
  • CentOS 7以及以上版本

yum安装

移除旧版本docker信息

# yum -y remove docker docker-ce docker-ce-cli docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

安装依赖包

# yum -y install yum-utils device-mapper-persistent-data lvm2

设置docker的yum源

# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

查看docker版本

# yum list docker-ce --showduplicates | sort -r
Loading mirror speeds from cached hostfile
Loaded plugins: fastestmirror
* extras: mirrors.sonic.net
* epel: mirror.math.princeton.edu
docker-ce.x86_64 :19.03.-.el7 docker-ce-stable
docker-ce.x86_64 :19.03.-.el7 docker-ce-stable
docker-ce.x86_64 :19.03.-.el7 docker-ce-stable
docker-ce.x86_64 :19.03.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 :18.09.-.el7 docker-ce-stable
docker-ce.x86_64 18.06..ce-.el7 docker-ce-stable
docker-ce.x86_64 18.06..ce-.el7 docker-ce-stable
docker-ce.x86_64 18.06..ce-.el7 docker-ce-stable
docker-ce.x86_64 18.06..ce-.el7 docker-ce-stable
docker-ce.x86_64 18.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 18.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.12..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.12..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.09..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.09..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.06..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7 docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable
docker-ce.x86_64 17.03..ce-.el7.centos docker-ce-stable
Available Packages

安装最新版本docker

# yum -y install docker-ce docker-ce-cli containerd.io

修改docker系统服务,替换默认的Root directory

源文件

# cat /usr/lib/systemd/system/docker.service
...
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
...

替换为

ExecStart=/usr/bin/dockerd --data-root=/usr/local/docker -H fd:// --containerd=/run/containerd/containerd.sock

重新加载配置文件

# systemctl daemon-reload

启动docker

# systemctl enable docker
# systemctl start docker
# systemctl status docker

有时候以普通用户使用docker的时候会报错

$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/json: dial unix /var/run/docker.sock: connect: permission denied

这时候需要把用户加入到一个叫做“docker”组里。

# usermod tnuser -G docker

docker安装详解的更多相关文章

  1. centos7 docker安装详解

    查看内核和操作系统版本[root@prod3 ~]# uname -r3.10.0-327.el7.x86_64[root@prod3 ~]# cat /etc/redhat-release Cent ...

  2. Win10 TensorFlow(gpu)安装详解

    Win10 TensorFlow(gpu)安装详解 写在前面:TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,其命名来源于本身的运行原理.Tensor(张量)意味着 ...

  3. Docker命令详解

    Docker命令详解   最近学习Docker,将docker所有命令实验了一番,特整理如下: # docker --help Usage: docker [OPTIONS] COMMAND [arg ...

  4. Linux ssh登录和软件安装详解

    阿哲Style   Linux第一天 ssh登录和软件安装详解 Linux学习第一天 操作环境: Ubuntu 16.04 Win10系统,使用putty_V0.63 本身学习Linux就是想在服务器 ...

  5. 【转】Linux下Android ADB驱动安装详解

    原文网址:http://blog.csdn.net/zhenwenxian/article/details/5901350 Linux下Android ADB驱动安装详解 概述 最近由于内置的合作商比 ...

  6. scribefire 多博客管理利器 安装详解

    scribefire 多博客管理利器 安装详解 一.ScribeFire介绍 ScribeFire 是 Firefox (火狐浏览器)上著名的博客写作工具,目前已跨平台支持多浏览器(Firefox,C ...

  7. CentOS 6.5的安装详解

    CentOS 6.5的安装详解 主流: 目前的Linux操作系统主要应用于生产环境, 主流企业级Linux系统仍旧是RedHat或者CentOS 免费: RedHat 和CentOS差别不大,Cent ...

  8. Linux下tomcat的安装详解

    Linux下tomcat的安装详解 来源: ChinaUnix博客 日期: 2007.01.21 22:59 (共有0条评论) 我要评论 一,安装前的准备:1,Linux版本:我的是企业版.(至于红帽 ...

  9. Phoenix和SQuirrel安装详解

    Phoenix安装详解 描述 现有hbase的查询工具有很多如:Hive,Tez,Impala,Shark/Spark,Phoenix等.今天的主角是Phoenix. phoenix,中文译为“凤凰” ...

随机推荐

  1. string、wstring、CString 相互转换

    关于string wstring cstring的功能这里不详细叙述了 可参见这里:https://www.cnblogs.com/guolixiucai/p/4716521.html 关于转换这里只 ...

  2. js 引号 转义字符 json字符串

    element_obj.NewTitle.value = json_obj.NewTitle.replace(/\"/g, "\""); model.NewTi ...

  3. js 创建节点 以及 节点属性 删除节点

    case 'copy': var B1 = document.getElementById("B1"); //获得B1下的html文本 var copy_dom = documen ...

  4. PHP大文件上传断点续传解决方案

    1.使用PHP的创始人 Rasmus Lerdorf 写的APC扩展模块来实现(http://pecl.php.net/package/apc) APC实现方法: 安装APC,参照官方文档安装,可以使 ...

  5. CodeForces 349B--Color the Fence(贪心)

    B. Color the Fence time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  6. JS框架_(JQuery.js)文章全屏动画切换

    百度云盘 传送门 密码:anap 文章全屏动画切换效果 <!doctype html> <html lang="zh"> <head> < ...

  7. sqli-labs(44)

    第四十四关 本关是基于盲注的,这里盲注主要是要没有报错信息,所以要采用盲注.这关与42关的区别就在于没有报错信息 过滤点: $username = mysqli_real_escape_string( ...

  8. Static class 与non static class的区别

    内部静态类不需要有指向外部类的引用.但非静态内部类需要持有对外部类的引用.非静态内部类能够访问外部类的静态和非静态成员.静态类不能访问外部类的非静态成员.他只能访问外部类的静态成员.一个非静态内部类不 ...

  9. C++入门经典-例3.4-根据成绩划分等级

    1:代码如下: // 3.4.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> using ...

  10. C博客作业05--指针 批改总结

    1.0如题 1.1 一.评分规则 1.伪代码务必是文字+代码描述,直接反应代码,每题扣1分 2.提交列表没内容,或者太简单,每题得分0分.注意选择提交列表长的题目介绍. 3.代码格式不规范,包括命名随 ...