From f411d84e9199a5ef6acb43d0ba2898fda69aacf2 Mon Sep 17 00:00:00 2001 From: chemavx Date: Wed, 22 Apr 2026 17:38:42 +0000 Subject: [PATCH] ci: switch to plain docker build avoiding docker-container driver The docker-container buildkitd driver creates an isolated process that cannot use DinD's registry-mirror config, and the cluster's registry-cache returns 500 on BuildKit's ?ns=docker.io mirror protocol. Plain docker build routes through the DinD daemon directly, which already has registry-mirrors configured for docker.io pull-through cache. Uses BUILDKIT_INLINE_CACHE=1 for layer caching between builds. Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/ci.yml | 78 +++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 46 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c2d0cb8..6fdfed2 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -24,58 +24,44 @@ jobs: run: echo "TAG=${GITHUB_SHA::8}" >> $GITHUB_OUTPUT - name: Log in to registry - uses: docker/login-action@v3 - with: - registry: git.chemavx.xyz - username: chemavx - password: ${{ secrets.CI_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - driver-opts: network=host - buildkitd-config-inline: | - [registry."git.chemavx.xyz"] - http = true - insecure = true - - [registry."docker.io"] - mirrors = ["registry-cache.registry-cache.svc.cluster.local:5000"] - - [registry."registry-cache.registry-cache.svc.cluster.local:5000"] - http = true - insecure = true + run: echo "${{ secrets.CI_TOKEN }}" | docker login git.chemavx.xyz -u chemavx --password-stdin - name: Build and push bot image - uses: docker/build-push-action@v3 - with: - context: . - file: Dockerfile - push: true - tags: git.chemavx.xyz/chemavx/polymarket-bot:${{ steps.tag.outputs.TAG }} - cache-from: type=registry,ref=git.chemavx.xyz/chemavx/polymarket-bot:buildcache - cache-to: type=registry,ref=git.chemavx.xyz/chemavx/polymarket-bot:buildcache,mode=max + run: | + TAG=${{ steps.tag.outputs.TAG }} + docker build \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --cache-from git.chemavx.xyz/chemavx/polymarket-bot:buildcache \ + -t git.chemavx.xyz/chemavx/polymarket-bot:${TAG} \ + -t git.chemavx.xyz/chemavx/polymarket-bot:buildcache \ + -f Dockerfile . + docker push git.chemavx.xyz/chemavx/polymarket-bot:${TAG} + docker push git.chemavx.xyz/chemavx/polymarket-bot:buildcache - name: Build and push API image - uses: docker/build-push-action@v3 - with: - context: . - file: Dockerfile.api - push: true - tags: git.chemavx.xyz/chemavx/polymarket-bot-api:${{ steps.tag.outputs.TAG }} - cache-from: type=registry,ref=git.chemavx.xyz/chemavx/polymarket-bot-api:buildcache - cache-to: type=registry,ref=git.chemavx.xyz/chemavx/polymarket-bot-api:buildcache,mode=max + run: | + TAG=${{ steps.tag.outputs.TAG }} + docker build \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --cache-from git.chemavx.xyz/chemavx/polymarket-bot-api:buildcache \ + -t git.chemavx.xyz/chemavx/polymarket-bot-api:${TAG} \ + -t git.chemavx.xyz/chemavx/polymarket-bot-api:buildcache \ + -f Dockerfile.api . + docker push git.chemavx.xyz/chemavx/polymarket-bot-api:${TAG} + docker push git.chemavx.xyz/chemavx/polymarket-bot-api:buildcache - name: Build and push dashboard image - uses: docker/build-push-action@v3 - with: - context: dashboard - file: dashboard/Dockerfile - push: true - tags: git.chemavx.xyz/chemavx/polymarket-bot-dashboard:${{ steps.tag.outputs.TAG }} - cache-from: type=registry,ref=git.chemavx.xyz/chemavx/polymarket-bot-dashboard:buildcache - cache-to: type=registry,ref=git.chemavx.xyz/chemavx/polymarket-bot-dashboard:buildcache,mode=max + run: | + TAG=${{ steps.tag.outputs.TAG }} + docker build \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + --cache-from git.chemavx.xyz/chemavx/polymarket-bot-dashboard:buildcache \ + -t git.chemavx.xyz/chemavx/polymarket-bot-dashboard:${TAG} \ + -t git.chemavx.xyz/chemavx/polymarket-bot-dashboard:buildcache \ + -f dashboard/Dockerfile \ + dashboard + docker push git.chemavx.xyz/chemavx/polymarket-bot-dashboard:${TAG} + docker push git.chemavx.xyz/chemavx/polymarket-bot-dashboard:buildcache - name: Update k8s manifests run: |