Allow specify registry-mirrors or proxies in `/etc/docker/daemon.json`

Problem/Justification
The Chinese government blocks access to Docker Hub, you may find articles like Chinese Docker Hub Complete Shutdown: How Far Can Kubernetes Image Repositories Go? | by Mr.PlanB | Medium . TrueNAS Apps are affected and Chinese users cannot install/update any app.

Possible solutions

To ‘fix’ the networking issue, Chinese people find a way to set up self-hosted Docker Hub mirrors, they have to specify registry-mirrors in /etc/docker/daemon.json , this file is managed by TrueNAS middleware.

Example content in daemon.json:

{
  "registry-mirrors": ["https://docker.example.mirror.io"]
}

There is another way to workaround the networking issue, please provide Docker daemon proxy configuration entries, the detailed configuration is described in Daemon proxy configuration | Docker Docs

The original issue from Jira: [NAS-131111] - iXsystems TrueNAS Jira

Truenas Scale uses Rancher K3S as its container solution. To resolve the issue, you can refer to the following documentation:
k3s-private-registry
and
k3s-registry-mirror

Currently. With the release of Electric Eel, which I understand is scheduled for 1 October, this will cease to be the case, and they’ll use Docker instead. Which some people apparently think is an improvement for some reason.

For me personally, I’m familiar with both K8s and Docker, and the solutions for this issue are pretty similar. But it’s true that more users are familiar with Docker rather than containerd, so lowering the learning curve for users is definitely a good thing.

Implemented registry-mirrors on my self-build.