开发者社区 > 云效DevOps > 正文

阿里云云效流水线,构建node.js代码完成后,部署镜像构建失败为什么?

阿里云云效流水线,构建node.js代码完成后,部署镜像构建失败(本地ECS环境是正常构建成功的),这是什么原因呢?image.png
[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

展开
收起
三分钟热度的鱼 2023-09-27 13:38:13 252 0
1 条回答
写回答
取消 提交回答
  • 如果您不能让node构建和镜像构建在一个任务中,就需要上传构建产物,我看您已经有这个步骤了,然后在镜像构建的时候添加构建参数:
    之后在Dockerfile里用ARG接收一下这个参数,然后ADD 这个参数到您的镜像中,实现远程下载制品。image.png
    image.png
    此回答整理自钉群“云效交付域答疑群”

    2023-09-27 13:52:35
    赞同 展开评论 打赏

云效,企业级一站式研发协同平台,数十万企业都在用。支持公共云、专有云和混合云多种部署形态,通过云原生新技术和研发新模式,助力创新创业和数字化转型企业快速实现研发敏捷和组织敏捷,打造“双敏”组织,实现多倍效能提升。

热门讨论

热门文章

相关电子书

更多
探究 Node.js 的服务端之路 立即下载
个推微服务实践 基于OpenResty 和Node.js 立即下载
沪江基于Node.js大规模应用实践 立即下载