热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何在CentOS7中更改docker守护程序根目录

如何解决《如何在CentOS7中更改docker守护程序根目录》经验,为你挑选了1个好方法。

我在CentOS7中运行docker.

我想将我的基本目录从更改/var/lib/docker/data/docker.

我从官方网站上找到了这个指南,但不知道如何将这个应用到我的案例中.

我只是让新daemon.json/etc/docker/.之后,当我尝试运行守护进程时发生错误.

跟着是systemctl status -l docker.service.

? docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2017-04-27 15:07:41 KST; 47s ago
     Docs: https://docs.docker.com
  Process: 42547 ExecStart=/usr/bin/dockerd (code=exited, status=1/FAILURE)
 Main PID: 42547 (code=exited, status=1/FAILURE)

Apr 27 15:07:41 DCSF-DEV08 systemd[1]: Starting Docker Application Container Engine...
Apr 27 15:07:41 DCSF-DEV08 dockerd[42547]: unable to configure the Docker daemon with file /etc/docker/daemon.json: the following directives don't match any configuration option: default-ulimits
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: Failed to start Docker Application Container Engine.
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: Unit docker.service entered failed state.
Apr 27 15:07:41 DCSF-DEV08 systemd[1]: docker.service failed.

那么我怎么能解决这个问题呢?(我想知道当我systemctl start docker没有运行时守护进程的默认设置是什么/etc/docker/daemon.json)

=========编辑===================

我现在的码头工人daemon.js.

{
    "api-cors-header": "",
    "authorization-plugins": [],
    "bip": "",
    "bridge": "",
    "cgroup-parent": "",
    "cluster-store": "",
    "cluster-store-opts": {},
    "cluster-advertise": "",
    "debug": true,
    "default-gateway": "",
    "default-gateway-v6": "",
    "default-runtime": "runc",
    "default-ulimits": {},
    "disable-legacy-registry": false,
    "dns": [],
    "dns-opts": [],
    "dns-search": [],
    "exec-opts": [],
    "exec-root": "",
    "fixed-cidr": "",
    "fixed-cidr-v6": "",
    "graph": "/data/docker",
    "group": "",
    "hosts": [],
    "icc": false,
    "insecure-registries": [],
    "ip": "0.0.0.0",
    "iptables": false,
    "ipv6": false,
    "ip-forward": false,
    "ip-masq": false,
    "labels": [],
    "live-restore": true,
    "log-driver": "",
    "log-level": "",
    "log-opts": {},
    "max-concurrent-downloads": 3,
    "max-concurrent-uploads": 5,
    "mtu": 0,
    "oom-score-adjust": -500,
    "pidfile": "",
    "raw-logs": false,
    "registry-mirrors": [],
    "runtimes": {
        "runc": {
            "path": "runc"
        },
        "custom": {
            "path": "/usr/local/bin/my-runc-replacement",
            "runtimeArgs": [
                "--debug"
            ]
        }
    },
    "selinux-enabled": false,
    "storage-driver": "",
    "storage-opts": [],
    "swarm-default-advertise-addr": "",
    "tls": true,
    "tlscacert": "",
    "tlscert": "",
    "tlskey": "",
    "tlsverify": true,
    "userland-proxy": false,
    "userns-remap": ""
}

我唯一改变的是graph,因为我只想更改根目录.(我想将其他人作为默认设置.default与配置相同systemctl start docker)



1> kstromeiraos..:

编辑/etc/docker/daemon.json.

仅提供以下内容:

{
    "graph": "/data/docker"
}

重启docker守护进程: sudo service docker restart


"graph"在以后的版本中已弃用 - 在这种情况下使用"data-root".
推荐阅读
  • 突然觉得服务器ssh密码登录总是浪费一定量的时间,就想试试用sshKey进行登录。生成服务器sshkey和本地sshkey$ssh-keygen在服务器上生成一个authorize ... [详细]
  • 一、域名解析记录说明记录类型A:用来指定域名的IPv4地址(如:8.8.8.8),如果需要将域名指向一个IP ... [详细]
  • Lodash中文文档(v3.10.1)–“Collection”要领TranslatedbyPeckZegOriginalDocs:Lodashv3.10.1Docs乞助翻译文档的 ... [详细]
  • 大数据学习环境安装关于防火墙​centos7使用的是firewalld,centos之前使用的是iptablesCentOS7关闭防火墙查看防火墙状态sudosy ... [详细]
  • 一安装配置1.配置文件mongod.cfg(路径:D:\data\config\mongod.cfg)如下:    systemLog:destination ... [详细]
  • 在云服务器中搭建Jupyter Notebook环境
    目录前言二、JupyterNotebook搭建步骤1.云服务器准备2.安装Python及pip3.安装JupyterNotebook4.运行JupyterNoteboo ... [详细]
  • Mask-RCNN源码阅读笔记
    阅读了https:blog.csdn.netu011974639articledetails78483779?locationNum9&fps1这篇博客这篇博客介 ... [详细]
  • 本文介绍了在rhel5.5操作系统下搭建网关+LAMP+postfix+dhcp的步骤和配置方法。通过配置dhcp自动分配ip、实现外网访问公司网站、内网收发邮件、内网上网以及SNAT转换等功能。详细介绍了安装dhcp和配置相关文件的步骤,并提供了相关的命令和配置示例。 ... [详细]
  • Smali代码注入
    以下的内容是对官方MIUIV4移植教程的补充,其中一些工具的使用就不在这里赘述,请大家参考官方教程。好的,话不多说,进入正题 ... [详细]
  • 本文整理了Java中com.atlassian.scheduler.config.JobConfig类的一些代码示例,展示了JobConfig ... [详细]
  • 本人先前是linux的支持都,使用过后就成为了其的鄙视者,观点如下:linux想跟windows比,tmd先搞好软件安装的问题。在linux在动不动就要命令行,有多少人会这恶心的命令行。会命令 ... [详细]
  • 情况说明最近打开Github经常会遇到用户头像或者仓库中的图片无法预览。F12打开控制台也能看到一堆报错信息。解决方法找到hosts文件Win:C:\Windows\Sys ... [详细]
  • Nginx使用AWStats日志分析的步骤及注意事项
    本文介绍了在Centos7操作系统上使用Nginx和AWStats进行日志分析的步骤和注意事项。通过AWStats可以统计网站的访问量、IP地址、操作系统、浏览器等信息,并提供精确到每月、每日、每小时的数据。在部署AWStats之前需要确认服务器上已经安装了Perl环境,并进行DNS解析。 ... [详细]
  • 一句话解决高并发的核心原则
    本文介绍了解决高并发的核心原则,即将用户访问请求尽量往前推,避免访问CDN、静态服务器、动态服务器、数据库和存储,从而实现高性能、高并发、高可扩展的网站架构。同时提到了Google的成功案例,以及适用于千万级别PV站和亿级PV网站的架构层次。 ... [详细]
  • RouterOS 5.16软路由安装图解教程
    本文介绍了如何安装RouterOS 5.16软路由系统,包括系统要求、安装步骤和登录方式。同时提供了详细的图解教程,方便读者进行操作。 ... [详细]
author-avatar
张丽君2502934023
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有