January 29, 20206 yr 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, 20206 yr by galfordliu
February 5, 20206 yr 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, 20206 yr by qgymib
December 14, 20205 yr 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.
May 4, 20224 yr 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.
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.