1 Star 0 Fork 58

gnaygnil/docker

forked from src-openEuler/docker 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0151-docker-enable-setting-env-variable-to-disable-db-del.patch 1.13 KB
一键复制 编辑 原始数据 按行查看 历史
gnaygnil 提交于 2020-02-13 15:36 . docker: Fixed build error and URL
From e6f33061b2c9c6ce3676ec9be79d0bc99455bac6 Mon Sep 17 00:00:00 2001
From: xiadanni1 <xiadanni1@huawei.com>
Date: Thu, 21 Nov 2019 02:04:28 +0800
Subject: [PATCH] docker: enable setting env variable to disable db delete
reason: crash files will be cleaned up when daemon restart, this patch allows
users to set env variable to disable db files delete if they need.
Change-Id: Ibfc1ee02c8cd49dc05a1c0aa087af27cb0848c79
Signed-off-by: xiadanni1 <xiadanni1@huawei.com>
---
components/engine/cmd/dockerd/daemon.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/components/engine/cmd/dockerd/daemon.go b/components/engine/cmd/dockerd/daemon.go
index 744ec45..5fb8811 100644
--- a/components/engine/cmd/dockerd/daemon.go
+++ b/components/engine/cmd/dockerd/daemon.go
@@ -102,6 +102,9 @@ func cleanupLocalDBs(run, root string) {
return
}
}
+ if os.Getenv("DISABLE_CRASH_FILES_DELETE") == "true" {
+ return
+ }
cleanupLocalDB(filepath.Join(root, "containerd/daemon/io.containerd.metadata.v1.bolt/meta.db"))
cleanupLocalDB(filepath.Join(root, "builder/fscache.db"))
cleanupLocalDB(filepath.Join(root, "volumes/metadata.db"))
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gnaygnil/docker.git
git@gitee.com:gnaygnil/docker.git
gnaygnil
docker
docker
master

搜索帮助