galfordliu Posted January 29, 2020 Share Posted January 29, 2020 (edited) hi guys.i'm live in china ,so So I pull my docker mirror very, very slowly. i want set mirror use the following command “ mkdir -p /etc/docker tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] } EOF ” Then I restart my docker servers,It works 100 times faster。 Now the problem is, once I restart the nas, the file /etc/docker/daemon.json , failed to save....i used winscp to view the file. It doesn't exist so ,Is there a kind person who can help me Edited January 30, 2020 by galfordliu Quote Link to comment
qgymib Posted February 5, 2020 Share Posted February 5, 2020 got this question too. modify go file is not working. Quote Link to comment
trurl Posted February 5, 2020 Share Posted February 5, 2020 User Scripts plugin Quote Link to comment
qgymib Posted February 5, 2020 Share Posted February 5, 2020 (edited) 5 hours ago, trurl said: User Scripts plugin that was really helpful, thanks very much! here is the working script (tested on unRaid 6.8.2): #!/bin/bash #name=docker.registry_mirrors # prepare folder mkdir -p /etc/docker # update mirror tee /etc/docker/daemon.json << EOF { "registry-mirrors": ["https://docker.mirrors.ustc.edu.cn"] } EOF # restart docker service if necessary is_docker_running=$(/etc/rc.d/rc.docker status | awk 'NR == 1 {print} ' | grep running) echo $is_docker_running if [ ! -z "$is_docker_running" ]; then /etc/rc.d/rc.docker restart fi Edited February 5, 2020 by qgymib 1 Quote Link to comment
AshranPewter Posted December 14, 2020 Share Posted December 14, 2020 this is great, docker wasn't restarting when I ran this though. Got caught in an unmountable docker.img file. Hopefully that doesn't happen when array starts, it should create the file pretty quick before docker becomes active I'm guessing. Quote Link to comment
sjtuross Posted May 4, 2022 Share Posted May 4, 2022 when user script quits, it always kills child process. docker service restart can't be put in the script as it will kill it in the end. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.