fix:aio安装时docker cgroupdriver设置问题

pull/1014/head
gjmzj 2021-04-24 21:37:15 +08:00
parent 1845483369
commit 4a623ca9e4
1 changed files with 5 additions and 0 deletions

5
ezdown
View File

@ -137,11 +137,15 @@ EOF
# configuration for dockerd # configuration for dockerd
mkdir -p /etc/docker mkdir -p /etc/docker
DOCKER_VER_MAIN=$(echo "$DOCKER_VER"|cut -d. -f1)
CGROUP_DRIVER="cgroupfs"
((DOCKER_VER_MAIN>=20)) && CGROUP_DRIVER="systemd"
logger debug "generate docker config: /etc/docker/daemon.json" logger debug "generate docker config: /etc/docker/daemon.json"
if [[ "$REGISTRY_MIRROR" == CN ]];then if [[ "$REGISTRY_MIRROR" == CN ]];then
logger debug "prepare register mirror for $REGISTRY_MIRROR" logger debug "prepare register mirror for $REGISTRY_MIRROR"
cat > /etc/docker/daemon.json << EOF cat > /etc/docker/daemon.json << EOF
{ {
"exec-opts": ["native.cgroupdriver=$CGROUP_DRIVER"],
"registry-mirrors": [ "registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn", "https://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com" "http://hub-mirror.c.163.com"
@ -160,6 +164,7 @@ EOF
logger debug "standard config without registry mirrors" logger debug "standard config without registry mirrors"
cat > /etc/docker/daemon.json << EOF cat > /etc/docker/daemon.json << EOF
{ {
"exec-opts": ["native.cgroupdriver=$CGROUP_DRIVER"],
"max-concurrent-downloads": 10, "max-concurrent-downloads": 10,
"log-driver": "json-file", "log-driver": "json-file",
"log-level": "warn", "log-level": "warn",