How can I change image registry? #2797
-
In China ghcr.io is not accessable. on Homeassistant Core, we can simply modify to But methods above is not available on HAOS. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@sky96111 @yiqian987 Recently I found a hack to override configuration in
Anyway, the hack idea is to use an udev rule to mount udev/00-docker-mirrors-workaround.rules
udev/docker-daemon.json{
"storage-driver": "overlay2",
"log-driver": "journald",
"experimental": true,
"ip6tables": true,
"log-opts": {
"tag": "{{.Name}}"
},
"data-root": "/mnt/data/docker",
"deprecated-key-path": "/mnt/overlay/etc/docker/key.json",
"bip": "172.30.232.1/23",
"registry-mirrors": [
"https://docker.nju.edu.cn/"
],
"proxies": {
"http-proxy": "http://any.proxy.with.access.to.ghcr.io:3128",
"https-proxy": "https://any.proxy.with.access.to.ghcr.io:3129",
"no-proxy": "*.test.example.com,.example.org,127.0.0.0/8"
}
} Docker will be using this new configuration after system reboot. I'm not in China so I'm not able to test this workaround but hopefully this would inspire you to make some working solution 🙂 P.S. Here is a blog post describing the hack in more detail but it's in Russian… |
Beta Was this translation helpful? Give feedback.
@sky96111 @yiqian987 Recently I found a hack to override configuration in
/etc/docker/daemon.json
but I'm not sure if this is relevant to your case. Throughdaemon.json
it's possible to set docker.nju.edu.cn as registry mirror but that wouldn't work for the ghcr.io registry (only for the primary one at hub.docker.com).daemon.json
also allows you to configure a proxy server. Are there any proxies in China that you can use to access ghcr.io?Anyway, the hack idea is to use an udev rule to mount
daemon.json
on top of the read-only one. In HAOS you can configure custom udev rules using a USB stick so you need to create 2 files on the USB stick (or insideCONFIG
):udev/00-docker-mirrors-work…