feat: 更新 Docker 镜像构建和推送流程

This commit is contained in:
xiao 2024-11-26 11:06:56 +08:00 committed by cnb
parent 81cfe42568
commit 88535b06f8

View File

@ -5,17 +5,17 @@ $:
docker: docker:
build: build:
dockerfile: .ide/Dockerfile dockerfile: .ide/Dockerfile
lamp_bullseye:
push: push:
- runner: - runner:
tags: cnb:arch:amd64 tags: cnb:arch:amd64
services: services:
- docker - docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env: env:
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH}-linux-amd64 IMAGE_TAG: btpanel/baota:lamp_debian11-linux-amd64
stages: stages:
- name: docker login - 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 - name: docker build
script: docker build -t ${IMAGE_TAG} . script: docker build -t ${IMAGE_TAG} .
- name: docker push - name: docker push
@ -30,11 +30,12 @@ lamp_bullseye:
cpus: 16 cpus: 16
services: services:
- docker - docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env: env:
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH}-linux-arm64 IMAGE_TAG: btpanel/baota:lamp_debian11-linux-arm64
stages: stages:
- name: docker login - 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 - name: docker build
timeout: 3600s timeout: 3600s
script: docker build -t ${IMAGE_TAG} . script: docker build -t ${IMAGE_TAG} .
@ -44,13 +45,12 @@ lamp_bullseye:
type: cnb:resolve type: cnb:resolve
options: options:
key: build-arm64 key: build-arm64
- runner:
tags: cnb:arch:amd64 - services:
cpus: 2
services:
- docker - docker
imports: https://cnb.cool/btpanel/secret/-/blob/main/docker.yml
env: env:
IMAGE_TAG: ${CNB_DOCKER_REGISTRY}/${CNB_REPO_SLUG_LOWERCASE}:${CNB_BRANCH} IMAGE_TAG: btpanel/baota:lamp_debian11
stages: stages:
- name: await the amd64 - name: await the amd64
type: cnb:await type: cnb:await
@ -63,8 +63,8 @@ lamp_bullseye:
- name: manifest - name: manifest
image: cnbcool/manifest image: cnbcool/manifest
settings: settings:
username: $CNB_TOKEN_USER_NAME username: $DOCKER_USERNAME
password: $CNB_TOKEN password: $DOCKER_PASSWD
target: ${IMAGE_TAG} target: ${IMAGE_TAG}
template: ${IMAGE_TAG}-OS-ARCH template: ${IMAGE_TAG}-OS-ARCH
platforms: platforms: