feat: 更新 Docker 镜像构建和推送流程
更新了 Docker 镜像构建和推送流程,引入了外部配置文件,并修改了环境变量和脚本中的变量引用。
This commit is contained in:
parent
ecb961936c
commit
259aac4100
24
.cnb.yml
24
.cnb.yml
@ -5,17 +5,17 @@ $:
|
|||||||
docker:
|
docker:
|
||||||
build:
|
build:
|
||||||
dockerfile: .ide/Dockerfile
|
dockerfile: .ide/Dockerfile
|
||||||
lnmp_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:lnmp_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 @@ lnmp_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:lnmp_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} -f ./arm64/Dockerfile ./arm64
|
script: docker build -t ${IMAGE_TAG} -f ./arm64/Dockerfile ./arm64
|
||||||
@ -44,13 +45,12 @@ lnmp_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:lnmp_debian11
|
||||||
stages:
|
stages:
|
||||||
- name: await the amd64
|
- name: await the amd64
|
||||||
type: cnb:await
|
type: cnb:await
|
||||||
@ -63,8 +63,8 @@ lnmp_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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user