Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
221 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,48 @@ | ||
version: "3" | ||
services: | ||
web: | ||
# replace username/repo:tag with your name and image details | ||
image: eipwork/kuboard-press:latest | ||
deploy: | ||
replicas: 1 | ||
resources: | ||
limits: | ||
cpus: "0.1" | ||
memory: 500M | ||
restart_policy: | ||
condition: on-failure | ||
kuboard: | ||
image: eipwork/kuboard:lua | ||
ports: | ||
- "8081:80" | ||
- "8083:80" | ||
volumes: | ||
- ./docs:/usr/share/nginx/html | ||
networks: | ||
- webnet | ||
kubetrain: | ||
# replace username/repo:tag with your name and image details | ||
image: eipwork/kuboard-press:latest | ||
deploy: | ||
replicas: 1 | ||
resources: | ||
limits: | ||
cpus: "0.1" | ||
memory: 500M | ||
restart_policy: | ||
condition: on-failure | ||
ports: | ||
- "8082:80" | ||
volumes: | ||
- /Users/shaohuanqing/Kuboard/kuboard-workspace/kubetrain/root:/usr/share/nginx/html | ||
- /Users/shaohuanqing/Kuboard/kuboard-workspace/nginx-lua/docker/nginx.80.conf:/etc/nginx/conf.d/nginx.80.conf | ||
- /Users/shaohuanqing/Kuboard/kuboard-workspace/kuboard-press/docs:/usr/share/nginx/html | ||
- /Users/shaohuanqing/Kuboard/kuboard-workspace/nginx-lua/docker/nginx-jwt.lua:/usr/local/openresty/nginx/jwt-lua/resty/nginx-jwt.lua | ||
networks: | ||
- webnet | ||
# web: | ||
# # replace username/repo:tag with your name and image details | ||
# image: eipwork/kuboard-press:latest | ||
# deploy: | ||
# replicas: 1 | ||
# resources: | ||
# limits: | ||
# cpus: "0.1" | ||
# memory: 500M | ||
# restart_policy: | ||
# condition: on-failure | ||
# ports: | ||
# - "8081:80" | ||
# volumes: | ||
# - ./docs:/usr/share/nginx/html | ||
# networks: | ||
# - webnet | ||
# kubetrain: | ||
# # replace username/repo:tag with your name and image details | ||
# image: eipwork/kuboard-press:latest | ||
# deploy: | ||
# replicas: 1 | ||
# resources: | ||
# limits: | ||
# cpus: "0.1" | ||
# memory: 500M | ||
# restart_policy: | ||
# condition: on-failure | ||
# ports: | ||
# - "8082:80" | ||
# volumes: | ||
# - /Users/shaohuanqing/Kuboard/kuboard-workspace/kubetrain/root:/usr/share/nginx/html | ||
# networks: | ||
# - webnet | ||
networks: | ||
webnet: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
vssueId: 115 | ||
description: 修改 docker 镜像仓库地址,加快 docker 镜像的下载速度 | ||
meta: | ||
- name: keywords | ||
content: docker镜像加速 | ||
--- | ||
|
||
# Docker镜像加速 | ||
|
||
* docker 中,只能够为 docker 官方镜像仓库 hub.docker.com 提供 mirror 加速,自建的 docker 镜像仓库是不能配置 mirror 加速的; | ||
* 如果您参考 kuboard.cn 提供的 kubernetes 安装文档,默认使用的 docker mirror 是 https://registry.cn-hangzhou.aliyuncs.com 。 | ||
|
||
## 修改镜像仓库 mirror 地址 | ||
|
||
本文提供了快速修改的方式和手工修改的方式,效果相同 | ||
|
||
|
||
<b-tabs content-class="mt-3"> | ||
<b-tab title="快速修改" active> | ||
|
||
* 下面提供了四个 mirror 地址,您可以去掉其中任意一个地址的注释,以使用该 mirror 地址。 | ||
|
||
``` sh | ||
# Docker中国 mirror | ||
# export REGISTRY_MIRROR="https://registry.docker-cn.com" | ||
# 腾讯云 docker hub mirror | ||
# export REGISTRY_MIRROR="https://mirror.ccs.tencentyun.com" | ||
# DaoCloud 镜像 | ||
# export REGISTRY_MIRROR="http://f1361db2.m.daocloud.io" | ||
# 阿里云 docker hub mirror | ||
export REGISTRY_MIRROR=https://registry.cn-hangzhou.aliyuncs.com | ||
curl -sSL https://kuboard.cn/install-script/set_mirror.sh | sh -s ${REGISTRY_MIRROR} | ||
systemctl daemon-reload | ||
systemctl restart docker | ||
systemctl start kubelet # 假设您安装了 kubenetes | ||
``` | ||
|
||
</b-tab> | ||
<b-tab title="手工修改"> | ||
|
||
* 修改 /etc/docker/daemon.json 文件(如果没有,则创建): | ||
``` sh | ||
vim /etc/docker/daemon.json | ||
``` | ||
* 添加 registry-mirrors 字段: | ||
``` json | ||
{ | ||
"registry-mirrors": ["https://registry.cn-hangzhou.aliyuncs.com"] | ||
} | ||
``` | ||
* 重启 docker/kubelet | ||
|
||
```sh | ||
systemctl daemon-reload | ||
systemctl restart docker | ||
systemctl start kubelet # 假设您安装了 kubenetes | ||
``` | ||
|
||
</b-tab> | ||
</b-tabs> | ||
|
||
## 查看修改结果 | ||
* 执行命令 | ||
``` sh | ||
docker info | ||
``` | ||
* 查看结果 | ||
``` log {12} | ||
... | ||
Docker Root Dir: /var/lib/docker | ||
Debug Mode (client): false | ||
Debug Mode (server): false | ||
Registry: https://index.docker.io/v1/ | ||
Labels: | ||
Experimental: false | ||
Insecure Registries: | ||
127.0.0.0/8 | ||
Registry Mirrors: | ||
https://registry.cn-hangzhou.aliyuncs.com | ||
Live Restore Enabled: false | ||
Product License: Community Engine | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.