We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18027d1 commit 37425c5Copy full SHA for 37425c5
1 file changed
build-image.sh
@@ -31,10 +31,10 @@ docker run --privileged --rm tonistiigi/binfmt --install all
31
# 4. 多架构构建并推送至 Docker Hub(核心修改:用 buildx build --platform 指定多架构,--push 直接推送)
32
# 推送 latest 标签(无论 Node 版本是否为 latest,都推送 latest 作为默认标签)
33
docker buildx build \
34
- --platform "${TARGET_ARCHITECTURES}" \ # 指定多架构
35
- --build-arg NODE_VERSION="${NODE_VERSION}" \ # 传递 Node 版本参数
36
- -t "${DOCKER_HUB_REPO}:latest" \ # Docker Hub latest 标签
37
- --push . # 直接推送(无需本地 tag,Buildx 会自动处理多架构镜像索引)
+ --platform "${TARGET_ARCHITECTURES}" \
+ --build-arg NODE_VERSION="${NODE_VERSION}" \
+ -t "${DOCKER_HUB_REPO}:latest" \
+ --push .
38
39
# 若 Node 版本不是 latest/NA,额外推送版本标签(如 webdev:20)
40
if [[ ${NODE_VERSION} != "latest" && ${NODE_VERSION} != "NA" ]]; then
0 commit comments