fix(content): harden Docker practice guide

This commit is contained in:
yeasy
2026-06-16 21:23:21 -07:00
parent f4e684afeb
commit 9fdffa9d91
67 changed files with 343 additions and 278 deletions
+11 -1
View File
@@ -136,7 +136,17 @@ docker push ccr.ccs.tencentyun.com/my-namespace/my-app:v1.0
#### TKE 集群中使用 TCR 镜像
配置镜像拉取凭证后 Deployment 中直接引用 TCR 镜像
配置镜像拉取凭证后 Deployment 中直接引用 TCR 镜像Secret 必须创建在使用它的 namespace 下面示例使用 `default` namespace
```bash
$ kubectl create secret docker-registry tcr-secret \
--docker-server=ccr.ccs.tencentyun.com \
--docker-username=<username> \
--docker-password=<token-or-password> \
--namespace=default
```
> 安全提示在命令行直接输入密码或 token 可能进入 shell 历史记录生产环境可先 `docker login`再基于受保护的 `~/.docker/config.json` 创建 `kubernetes.io/dockerconfigjson` Secret或使用云厂商提供的托管凭据集成
```yaml
apiVersion: apps/v1