Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how can i change my docker Source Mirror

Featured Replies

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 by galfordliu

got this question too. modify go file is not working.

  • Community Expert

User Scripts plugin 

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 by qgymib

  • 10 months later...

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.

  • 1 year later...

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.