From 259aac410073d9b47a5d773b0d6d41c35bb0fe29 Mon Sep 17 00:00:00 2001 From: xiao Date: Tue, 26 Nov 2024 11:06:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20Docker=20=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E6=9E=84=E5=BB=BA=E5=92=8C=E6=8E=A8=E9=80=81=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新了 Docker 镜像构建和推送流程,引入了外部配置文件,并修改了环境变量和脚本中的变量引用。 --- .cnb.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.cnb.yml b/.cnb.yml index 7cfffef..63a5fa9 100644 --- a/.cnb.yml +++ b/.cnb.yml @@ -5,17 +5,17 @@ $: docker: build: dockerfile: .ide/Dockerfile -lnmp_bullseye: push: - runner: tags: cnb:arch:amd64 services: - docker + imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml env: - IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH}-linux-amd64 + IMAGE_TAG: btpanel/baota:lnmp_debian11-linux-amd64 stages: - name: docker login - script: docker login -u ${CNB_TOKEN_USER_NAME} -p "${CNB_TOKEN}" ${CNB_DOCKER_REGISTRY} + script: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWD" - name: docker build script: docker build -t ${IMAGE_TAG} . - name: docker push @@ -30,11 +30,12 @@ lnmp_bullseye: cpus: 16 services: - docker + imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml env: - IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH}-linux-arm64 + IMAGE_TAG: btpanel/baota:lnmp_debian11-linux-arm64 stages: - name: docker login - script: docker login -u ${CNB_TOKEN_USER_NAME} -p "${CNB_TOKEN}" ${CNB_DOCKER_REGISTRY} + script: docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWD" - name: docker build timeout: 3600s script: docker build -t ${IMAGE_TAG} -f ./arm64/Dockerfile ./arm64 @@ -44,13 +45,12 @@ lnmp_bullseye: type: cnb:resolve options: key: build-arm64 - - runner: - tags: cnb:arch:amd64 - cpus: 2 - services: + + - services: - docker + imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml env: - IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH} + IMAGE_TAG: btpanel/baota:lnmp_debian11 stages: - name: await the amd64 type: cnb:await @@ -63,8 +63,8 @@ lnmp_bullseye: - name: manifest image: cnbcool/manifest settings: - username: $CNB_TOKEN_USER_NAME - password: $CNB_TOKEN + username: $DOCKER_USERNAME + password: $DOCKER_PASSWD target: ${IMAGE_TAG} template: ${IMAGE_TAG}-OS-ARCH platforms: