N1 Docker 安装 AdGuardHome


折腾 91 阅 0 评

运行

# 忽略
docker rm -f AdGuardHome
docker volume rm AdGuardHome_data

# 新建卷
docker volume create AdGuardHome_data

docker run -d \
    --name=AdGuardHome \
    --restart always \
    -e TZ=Asia/Shanghai \
    -p 53:53/tcp \
    -p 53:53/udp \
    -p 667:67/udp \
    -p 668:68/tcp \
    -p 668:68/udp \
    -p 880:80/tcp \
    -p 4443:443/tcp \
    -p 853:853/tcp \
    -p 3000:3000/tcp \
    -v AdGuardHome_data:/opt/adguardhome/work \
    -v AdGuardHome_data:/opt/adguardhome/conf \
    adguard/adguardhome:arm64-latest

# https://hub.docker.com/r/adguard/adguardhome
访问 ip:3000

问题集

1.报错代码

docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).

解决:

mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
    "registry-mirrors": [
        "https://docker.mirrors.ustc.edu.cn",
    ]
}
EOF

# 国内镜像(多选一):
http://f1361db2.m.daocloud.io        # 不推荐
https://registry.docker-cn.com
https://dockerhub.azk8s.cn
https://reg-mirror.qiniu.com
https://hub-mirror.c.163.com
https://mirror.ccs.tencentyun.com
# 建议用信任度高的镜像,否则出现 standard_init_linux.go:211: exec user process caused "exec format error",
# 但换了镜像后却又会好的情况,捉摸不透。

# 当前镜像
docker info | grep "Registry Mirrors" -A 1

2.修改被占用端口即可

Error starting userland proxy: listen udp 0.0.0.0:68: bind: address already in use.

# 查看端口占用
lsof -i:<端口>

3.发现 web 无法访问。在后台查看该容器日志提示:

standard_init_linux.go:211: exec user process caused "exec format error"

# 解决 1:`docker run ... `最后面加上`:arm64-latest`即可。
# 解决 2:AdGuardHome.yaml 检查端口 `bind_port: xxxx` 是否对应。
更新 2019-10-20
评论 ( 0 )
私信
pic
code
pre