|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="zh-CN"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | + <title>镜像使用说明</title> |
| 7 | + <style> |
| 8 | + body { |
| 9 | + font-family: 'Roboto', sans-serif; |
| 10 | + margin: 0; |
| 11 | + padding: 0; |
| 12 | + background-color: #f4f4f4; |
| 13 | + } |
| 14 | + .header { |
| 15 | + background: linear-gradient(135deg, #667eea, #764ba2); |
| 16 | + color: #fff; |
| 17 | + padding: 20px 0; |
| 18 | + text-align: center; |
| 19 | + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); |
| 20 | + position: relative; |
| 21 | + } |
| 22 | + .github-link { |
| 23 | + position: absolute; |
| 24 | + top: 10px; |
| 25 | + right: 20px; |
| 26 | + color: #fff; |
| 27 | + text-decoration: none; |
| 28 | + } |
| 29 | + .github-icon { |
| 30 | + width: 24px; |
| 31 | + height: 24px; |
| 32 | + vertical-align: middle; |
| 33 | + } |
| 34 | + .container { |
| 35 | + max-width: 800px; |
| 36 | + margin: 40px auto; |
| 37 | + padding: 20px; |
| 38 | + background-color: #fff; |
| 39 | + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); |
| 40 | + border-radius: 10px; |
| 41 | + } |
| 42 | + .content { |
| 43 | + margin-bottom: 20px; |
| 44 | + } |
| 45 | + .footer { |
| 46 | + text-align: center; |
| 47 | + padding: 20px 0; |
| 48 | + background-color: #333; |
| 49 | + color: #fff; |
| 50 | + } |
| 51 | + pre { |
| 52 | + background-color: #272822; |
| 53 | + color: #f8f8f2; |
| 54 | + padding: 15px; |
| 55 | + border-radius: 5px; |
| 56 | + overflow-x: auto; |
| 57 | + } |
| 58 | + code { |
| 59 | + font-family: 'Source Code Pro', monospace; |
| 60 | + } |
| 61 | + a { |
| 62 | + color: #4CAF50; |
| 63 | + text-decoration: none; |
| 64 | + } |
| 65 | + a:hover { |
| 66 | + text-decoration: underline; |
| 67 | + } |
| 68 | + @media (max-width: 600px) { |
| 69 | + .container { |
| 70 | + margin: 20px; |
| 71 | + padding: 15px; |
| 72 | + } |
| 73 | + .header { |
| 74 | + padding: 15px 0; |
| 75 | + } |
| 76 | + } |
| 77 | + </style> |
| 78 | + <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Source+Code+Pro:wght@400;700&display=swap" rel="stylesheet"> |
| 79 | +</head> |
| 80 | +<body> |
| 81 | +<div class="header"> |
| 82 | + <h1>镜像使用说明</h1> |
| 83 | + <a href="https://github.com/lixd/cloudflare-docker-proxy" target="_blank" class="github-link"> |
| 84 | + <img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" class="github-icon"> |
| 85 | + </a> |
| 86 | +</div> |
| 87 | +<div class="container"> |
| 88 | + <div class="content"> |
| 89 | + <p>为了加速 Docker 镜像拉取,你可以使用以下命令设置 registry mirror:</p> |
| 90 | + <pre><code id="registry-config">sudo tee /etc/docker/daemon.json <<EOF |
| 91 | +{ |
| 92 | + "registry-mirrors": ["https://{{host}}"] |
| 93 | +} |
| 94 | +EOF |
| 95 | +# 配置完后需要重启 Docker 服务 |
| 96 | +sudo systemctl restart docker |
| 97 | +</code></pre> |
| 98 | + <p>使用该代理从不同的镜像仓库拉取镜像,请参考以下命令:</p> |
| 99 | + <pre><code id="commands"> |
| 100 | +# docker pull nginx:latest |
| 101 | +docker pull docker.{{host}}/library/nginx:latest # 拉取 Docker 官方镜像 |
| 102 | + |
| 103 | +# docker pull quay.io/coreos/etcd:latest |
| 104 | +docker pull quay.{{host}}/coreos/etcd:latest # 拉取 Quay 镜像 |
| 105 | + |
| 106 | +# docker pull gcr.io/google-containers/busybox:latest |
| 107 | +docker pull gcr.{{host}}/google-containers/busybox:latest # 拉取 GCR 镜像 |
| 108 | + |
| 109 | +# docker pull k8s.gcr.io/pause:latest |
| 110 | +docker pull k8s-gcr.{{host}}/pause:latest # 拉取 k8s.gcr.io 镜像 |
| 111 | + |
| 112 | +# docker pull registry.k8s.io/pause:latest |
| 113 | +docker pull k8s.{{host}}/pause:latest # 拉取 registry.k8s.io 镜像 |
| 114 | + |
| 115 | +# docker pull ghcr.io/github/super-linter:latest |
| 116 | +docker pull ghcr.{{host}}/github/super-linter:latest # 拉取 GitHub 容器镜像 |
| 117 | + |
| 118 | +# docker pull docker.cloudsmith.io/public/repo/image:latest |
| 119 | +docker pull cloudsmith.{{host}}/public/repo/image:latest # 拉取 Cloudsmith 镜像 |
| 120 | +</code></pre> |
| 121 | + <p>为了避免 Worker 用量耗尽,你可以手动 pull 镜像然后 re-tag 之后 push 至本地镜像仓库。</p> |
| 122 | + </div> |
| 123 | +</div> |
| 124 | +<div class="footer"> |
| 125 | + <p>Powered by Cloudflare Workers</p> |
| 126 | + <p><a href="https://lixueduan.com" target="_blank">访问博客 探索云原生</a></p> |
| 127 | +</div> |
| 128 | +<script> |
| 129 | + document.addEventListener('DOMContentLoaded', function() { |
| 130 | + const host = window.location.hostname; |
| 131 | + const mainDomain = host.split('.').slice(-2).join('.'); |
| 132 | + const registryConfigElement = document.getElementById('registry-config'); |
| 133 | + const commandsElement = document.getElementById('commands'); |
| 134 | + |
| 135 | + registryConfigElement.innerHTML = registryConfigElement.innerHTML.replace(/{{host}}/g, host); |
| 136 | + commandsElement.innerHTML = commandsElement.innerHTML.replace(/{{host}}/g, mainDomain); |
| 137 | + }); |
| 138 | +</script> |
| 139 | +</body> |
| 140 | +</html> |
0 commit comments