阿里云云效流水线,构建node.js代码完成后,部署镜像构建失败(本地ECS环境是正常构建成功的),这是什么原因呢?
[executionStep begins at 2023-09-19 15:59:23]
[INFO] PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
x001b[92m[15:59:24] [SUCCESS] 鑾峰彇 Credential 鎴愬姛
[1m[15:59:24] [INFO] 浣跨敤宸ヤ綔璺緞/root/workspace/front_bbs_oS67
[1m[15:59:24] [INFO] 鎵ц姝ラ
[15:59:24] [USER]NODEGROUP_TYPE=K8S
[15:59:24] [INFO]USE BUILDKIT
[15:59:24] [INFO]PIPELINE_ID=2614205
[15:59:24] [INFO]PIPELINE_NAME=娴佹按绾� 2023-09-18
[15:59:24] [INFO]BUILD_NUMBER=4
[15:59:24] [INFO]EMPLOYEE_ID=5ed4ac48893c20c8bfa3b75b
[15:59:24] [INFO]WORK_SPACE=/root/workspace
[15:59:24] [INFO]PROJECT_DIR=/root/workspace/front_bbs_oS67
[15:59:24] [INFO]BUILD_JOB_ID=155115603
[15:59:24] [INFO]ENGINE_GLOBAL_PARAM_ORGANIZATION_ID=6507baa338d942876f45aa06
[15:59:24] [USER]BUILD_ARGS=
[15:59:24] [INFO]STEP_ID=10_1695109063447__11_1695109063448
[15:59:24] [USER]NO_CACHE=false
[15:59:24] [USER]CACHE_MODE=local
[15:59:24] [INFO]BUILDKIT_VERSION=v0.8.0
[15:59:24] [INFO] prepare buildkit
[15:59:24] [INFO] set buildkit version to v0.8.0
[15:59:25] [INFO] prepare dockerhub auth
[15:59:25] [INFO] prepare user docker registry auth
[15:59:25] [INFO] USER_REGISTRY=registry.cn-hangzhou.aliyuncs.com
[15:59:25] [INFO]闀滃儚鏋勫缓灏嗕娇鐢� buildkit
[15:59:25] [INFO] DOCKER_FILE_DIR=/root/workspace/front_bbs_oS67
[15:59:25] [INFO] DOCKER_FILE_NAME=Dockerfile
[15:59:25] [USER]DOCKER_TAG=2023-09-19-15-57-14
[15:59:25] [USER]EXTRA_TAGS=
[15:59:25] registry.cn-hangzhou.aliyuncs.com/nfc/bbs_page
[15:59:25] buildctl github.com/moby/buildkit v0.8.0 73fe4736135645a342abc7b587bba0994cccf0f9
[15:59:25] [INFO] buildkit ready.
[15:59:25] docker login --username=cr_temp_user --password=** registry.cn-hangzhou.aliyuncs.com
[15:59:25] WARNING! Using --password via the CLI is insecure. Use --password-stdin.
[15:59:25] WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
[15:59:25] Configure a credential helper to remove this warning. See
[15:59:25] https://docs.docker.com/engine/reference/commandline/login/#credentials-store
[15:59:25]
[15:59:25] Login Succeeded
[15:59:25] buildctl build --frontend dockerfile.v0 --local context=/root/workspace/front_bbs_oS67 --local dockerfile=/root/workspace/front_bbs_oS67 --opt filename=Dockerfile --output type=image,"name=registry.cn-hangzhou.aliyuncs.com/nfc/bbs_page:2023-09-19-15-57-14",push=true
[15:59:26] #1 [internal] load build definition from Dockerfile
[15:59:26] #1 sha256:b5f7485b31130878d4351b35c707494e3bfa4c633bdbb40ee0df80a1f7d164fd
[15:59:26] #1 transferring dockerfile: 374B done
[15:59:26] #1 DONE 0.0s
[15:59:26]
[15:59:26] #2 [internal] load .dockerignore
[15:59:26] #2 sha256:0328cf41cd1c04712c56998e56858d91ea2ddd38d84b20a280b049db389aa278
[15:59:26] #2 transferring context: 2B done
[15:59:26] #2 DONE 0.0s
[15:59:26]
[15:59:26] #3 [internal] load metadata for docker.io/library/nginx:1.17.2
[15:59:26] #3 sha256:d6da51a0be923f34f30d44463c8f51e090924174eb4d13fc24f2321db00f7a04
[15:59:26] #3 ...
[15:59:26]
[15:59:26] #4 [auth] library/nginx:pull token for r
如果您不能让node构建和镜像构建在一个任务中,就需要上传构建产物,我看您已经有这个步骤了,然后在镜像构建的时候添加构建参数:
之后在Dockerfile里用ARG接收一下这个参数,然后ADD 这个参数到您的镜像中,实现远程下载制品。
此回答整理自钉群“云效交付域答疑群”
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
云效,企业级一站式研发协同平台,数十万企业都在用。支持公共云、专有云和混合云多种部署形态,通过云原生新技术和研发新模式,助力创新创业和数字化转型企业快速实现研发敏捷和组织敏捷,打造“双敏”组织,实现多倍效能提升。