在 Docker 容器中运行 CI/CD 作业
要仔细多看几遍文档: https://gitlab.yitasoft.com/help/ci/docker/using_docker_images.md#use-statically-defined-credentials
如何让 job 的 image 使用私有 registry 的镜像
准备所需的 base64 编码版本 ${username}:${password} 并手动创建 Docker 配置 JSON。打开终端并执行以下命令:
# The use of "-n" - prevents encoding a newline in the password.
echo -n "my_username:my_password" | base64
# Example output to copy
bXlfdXNlcm5hbWU6bXlfcGFzc3dvcmQ=
创建 Docker JSON 配置内容如下:
{
"auths": {
"registry.example.com:5000": {
"auth": "(Base64 content from above)"
}
}
}