Docker 脚本指定镜像仓库命令选项新增支持指定多个地址

This commit is contained in:
Super Manito
2025-10-23 05:35:17 +08:00
parent 06bc87f75e
commit 51be34be62
7 changed files with 90 additions and 20 deletions

View File

@@ -234,7 +234,7 @@ Command options(name/meaning/value):
| Name | Meaning | Value |
| :-: | :-: | :-: |
| `--source` | Specify `Docker CE` mirror address (domain or IP) | `address` |
| `--source-registry` | Specify `Docker Registry` mirror address (domain or IP) | `address` |
| `--source-registry` | Specify `Docker Registry` mirror address (domain or IP) | `address (separate multiple entries with commas)` |
| `--branch` | Specify `Docker CE` mirror repository (path) | `repo name (see docs below)` |
| `--branch-version` | Specify `Docker CE` mirror repository version | `version (see docs below)` |
| `--designated-version` | Specify `Docker Engine` installation version | `version (see docs below)` |
@@ -258,6 +258,13 @@ Command options(name/meaning/value):
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --source-registry registry.example.com
```
Can specify multiple addresses at the same time, and they must be separated by commas.
``` { .bash .no-copy }
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en \
--source-registry "registry-1.example.com,registry-2.example.com"
```
- ### Only Switch Registry Mirror
=== "Use Script for One-Click Replacement"
@@ -268,6 +275,14 @@ Command options(name/meaning/value):
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en --only-registry
```
Lazy one-click command (using multiple addresses)
``` bash
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --en \
--only-registry \
--source-registry "docker.1ms.run,docker.1panel.live,docker.m.daocloud.io"
```
=== "Manual Replacement"
- Install the `jq` package

View File

@@ -234,7 +234,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
| 名称 | 含义 | 选项值 |
| :-: | :-: | :-: |
| `--source` | 指定 `Docker CE` 源地址(域名或IP) | `地址` |
| `--source-registry` | 指定 `Docker` 镜像仓库地址(域名或IP) | `地址` |
| `--source-registry` | 指定 `Docker` 镜像仓库地址(域名或IP) | `地址(多个用英文逗号分割)` |
| `--branch` | 指定 `Docker CE` 软件源仓库(路径) | `仓库名(详见下方文档)` |
| `--branch-version` | 指定 `Docker CE` 软件源仓库版本 | `版本号(详见下方文档)` |
| `--designated-version` | 指定 `Docker Engine` 安装版本 | `版本号(详见下方文档)` |
@@ -258,6 +258,13 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --source-registry registry.example.com
```
可以同时指定多个地址,需使用英文逗号进行分割
``` { .bash .no-copy }
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) \
--source-registry "registry-1.example.com,registry-2.example.com"
```
- ### 仅更换镜像仓库
=== "使用脚本一键替换"
@@ -268,6 +275,14 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --help
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --only-registry
```
懒人一键命令(使用多个地址)
``` bash
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) \
--only-registry \
--source-registry "docker.1ms.run,docker.1panel.live,docker.m.daocloud.io"
```
=== "手动替换"
- 安装 `jq` 软件包

View File

@@ -234,7 +234,7 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant --help
| 名稱 | 意義 | 選項值 |
| :-: | :-: | :-: |
| `--source` | 指定 `Docker CE` 軟體源位址(網域名稱或IP) | `位址` |
| `--source-registry` | 指定 `Docker` 映像倉庫位址(網域名稱或IP) | `位址` |
| `--source-registry` | 指定 `Docker` 映像倉庫位址(網域名稱或IP) | `位址(多個用英文逗號分割)` |
| `--branch` | 指定 `Docker CE` 軟體源倉庫(路徑) | `倉庫名稱(詳見下方文件)` |
| `--branch-version` | 指定 `Docker CE` 軟體源倉庫版本 | `版本號(詳見下方文件)` |
| `--designated-version` | 指定 `Docker Engine` 安裝版本 | `版本號(詳見下方文件)` |
@@ -258,6 +258,13 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant --help
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant --source-registry registry.example.com
```
可同時指定多個地址,需使用英文逗號分割
``` { .bash .no-copy }
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant \
--source-registry "registry-1.example.com,registry-2.example.com"
```
- ### 僅更換映像倉庫
=== "使用腳本一鍵替換"
@@ -268,6 +275,14 @@ $ bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant --help
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant --only-registry
```
懶人一鍵指令(使用多個位址)
``` bash
bash <(curl -sSL https://linuxmirrors.cn/docker.sh) --zh-hant \
--only-registry \
--source-registry "docker.1ms.run,docker.1panel.live,docker.m.daocloud.io"
```
=== "手動替換"
- 安裝 `jq` 軟體包

View File

@@ -648,8 +648,8 @@ Below are some advanced usage examples
``` bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --en \
--codename trixie \
--upgrade-software false
--codename trixie \
--upgrade-software false
```
- Disable the backports repository
@@ -678,8 +678,8 @@ Below are some advanced usage examples
``` bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --en \
--codename testing \
--upgrade-software false
--codename testing \
--upgrade-software false
```
``` { .bash .no-copy title="If the script can't set the codename, you can manually replace it after running" }

View File

@@ -650,8 +650,8 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
``` bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
--codename trixie \
--upgrade-software false
--codename trixie \
--upgrade-software false
```
- 禁用 backports 仓库
@@ -680,8 +680,8 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --help
``` bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) \
--codename testing \
--upgrade-software false
--codename testing \
--upgrade-software false
```
``` { .bash .no-copy title="若脚本无法实现指定版本代号,你也可以在执行脚本后手动替换" }

View File

@@ -650,8 +650,8 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --zh-hant --help
``` bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --zh-hant \
--codename trixie \
--upgrade-software false
--codename trixie \
--upgrade-software false
```
- 停用 backports 倉庫
@@ -680,8 +680,8 @@ $ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --zh-hant --help
``` bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --zh-hant \
--codename testing \
--upgrade-software false
--codename testing \
--upgrade-software false
```
``` { .bash .no-copy title="如果腳本無法實現指定版本代號,你也可以在執行腳本後手動替換" }