openwrt 中 docker
28 December 2024
Openwrt 中 docker 镜像源 mirror 配置
查看less /etc/init.d/dockerd 发现配置如下:
DOCKER_CONF_DIR="/tmp/dockerd"
DOCKERD_CONF="${DOCKER_CONF_DIR}/daemon.json"
......
# docker 配置文件路径
if [ -z "${DOCKERD_CONF}" ]; then
procd_set_param command /usr/bin/dockerd
else
procd_set_param command /usr/bin/dockerd --config-file="${DOCKERD_CONF}"
fi
故修改 /etc/init.d/dockerd 中的 DOCKER_CONF_DIR=”/etc/docker”, 并将 /tmp/dockerd/daemon.json 复制到 /etc/docker/daemon.json:
mkdir /etc/docker
cp /tmp/dockerd/daemon.json /etc/docker/daemon.json
编辑 /etc/docker/daemon.json 后, 重启docker即可.
{
"data-root": "/opt/docker/",
"log-level": "warn",
"insecure-registries": [
"docker.xxxx.com",
"mark.docker"
],
"registry-mirrors": [
"https://docker.xxxx.com"
],
"iptables": true
}
