build: 分开镜像
This commit is contained in:
parent
2bcdca571a
commit
9f17657b7c
2
.github/buildkitd.toml
vendored
2
.github/buildkitd.toml
vendored
@ -1,2 +0,0 @@
|
|||||||
[worker.oci]
|
|
||||||
max-parallelism=1
|
|
||||||
@ -43,7 +43,7 @@ jobs:
|
|||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
echo ::set-output name=version::${TAG_NAME}
|
echo ::set-output name=version::${TAG_NAME}
|
||||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache --provenance=false \
|
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache \
|
||||||
--build-arg VERSION=${TAG_NAME} \
|
--build-arg VERSION=${TAG_NAME} \
|
||||||
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
||||||
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
||||||
@ -52,8 +52,6 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
|
||||||
config: .github/buildkitd.toml
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
@ -48,7 +48,7 @@ jobs:
|
|||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
echo ::set-output name=version::${TAG_NAME}
|
echo ::set-output name=version::${TAG_NAME}
|
||||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache --provenance=false \
|
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache \
|
||||||
--build-arg VERSION=${TAG_NAME} \
|
--build-arg VERSION=${TAG_NAME} \
|
||||||
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
||||||
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
||||||
@ -57,8 +57,6 @@ jobs:
|
|||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
|
||||||
config: .github/buildkitd.toml
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
77
.github/workflows/build-and-push.yml
vendored
77
.github/workflows/build-and-push.yml
vendored
@ -18,7 +18,7 @@ on:
|
|||||||
- linux/amd64,linux/arm64
|
- linux/amd64,linux/arm64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-fit2cloud-registry:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check Disk Space
|
- name: Check Disk Space
|
||||||
@ -42,86 +42,35 @@ jobs:
|
|||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prepare
|
id: prepare
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=registry-hkproxy.fit2cloud.com/maxkb/maxkb
|
DOCKER_IMAGE_FIT2CLOUD=registry-hkproxy.fit2cloud.com/maxkb/maxkb
|
||||||
|
DOCKER_IMAGE_DOCKERHUB=1panel/maxkb
|
||||||
DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
|
DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
|
||||||
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE_FIT2CLOUD}:${TAG_NAME} --tag ${DOCKER_IMAGE_FIT2CLOUD}:latest --tag ${DOCKER_IMAGE_DOCKERHUB}:${TAG_NAME} --tag ${DOCKER_IMAGE_DOCKERHUB}:latest"
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
|
||||||
echo ::set-output name=version::${TAG_NAME}
|
echo ::set-output name=version::${TAG_NAME}
|
||||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache --provenance=false \
|
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache \
|
||||||
--build-arg VERSION=${TAG_NAME} \
|
|
||||||
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
|
||||||
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
|
||||||
${DOCKER_IMAGE_TAGS} .
|
${DOCKER_IMAGE_TAGS} .
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
config: .github/buildkitd.toml
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GH_TOKEN }}
|
||||||
- name: Login to FIT2CLOUD Registry
|
- name: Login to FIT2CLOUD Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: registry-hkproxy.fit2cloud.com
|
registry: registry-hkproxy.fit2cloud.com
|
||||||
username: ${{ secrets.FIT2CLOUD_REGISTRY_USERNAME }}
|
username: ${{ secrets.FIT2CLOUD_REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.FIT2CLOUD_REGISTRY_PASSWORD }}
|
password: ${{ secrets.FIT2CLOUD_REGISTRY_PASSWORD }}
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
username: ${{ github.actor }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
password: ${{ secrets.GH_TOKEN }}
|
|
||||||
- name: Docker Buildx (build-and-push)
|
- name: Docker Buildx (build-and-push)
|
||||||
run: |
|
run: |
|
||||||
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} -f installer/Dockerfile
|
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} -f installer/Dockerfile
|
||||||
|
|
||||||
build-and-push-to-ghcr:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check Disk Space
|
|
||||||
run: df -h
|
|
||||||
- name: Free Disk Space (Ubuntu)
|
|
||||||
uses: jlumbroso/free-disk-space@main
|
|
||||||
with:
|
|
||||||
tool-cache: true
|
|
||||||
android: true
|
|
||||||
dotnet: true
|
|
||||||
haskell: true
|
|
||||||
large-packages: true
|
|
||||||
docker-images: true
|
|
||||||
swap-storage: true
|
|
||||||
- name: Check Disk Space
|
|
||||||
run: df -h
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: main
|
|
||||||
- name: Prepare
|
|
||||||
id: prepare
|
|
||||||
run: |
|
|
||||||
DOCKER_IMAGE=ghcr.io/1panel-dev/maxkb
|
|
||||||
DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
|
|
||||||
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
|
||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
|
||||||
echo ::set-output name=version::${TAG_NAME}
|
|
||||||
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --no-cache --provenance=false \
|
|
||||||
--build-arg VERSION=${TAG_NAME} \
|
|
||||||
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
|
|
||||||
--build-arg VCS_REF=${GITHUB_SHA::8} \
|
|
||||||
${DOCKER_IMAGE_TAGS} .
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
config: .github/buildkitd.toml
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GH_TOKEN }}
|
|
||||||
- name: Docker Buildx (build-and-push)
|
|
||||||
run: |
|
|
||||||
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }} -f installer/Dockerfile
|
|
||||||
Loading…
Reference in New Issue
Block a user