Drop buildkitd.toml CA config approach — it does not apply to BuildKit's OAuth token fetch which uses the Go system CA pool. Instead append the CA cert to the BuildKit container's /etc/ssl/certs/ca-certificates.crt and restart so buildkitd picks it up via the system pool.
47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
name: Build and push telegraf-snmp image
|
|
run-name: ${{ gitea.actor }} is building and pushing telegraf-snmp image
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'telegraf-snmp/**'
|
|
- '.gitea/workflows/telegraf-snmp.yaml'
|
|
|
|
env:
|
|
RESULT_IMAGE_NAME: tools/telegraf-snmp
|
|
|
|
jobs:
|
|
build-and-push-image:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Log in to registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.PRIVATE_REGISTRY_DOMAIN }}
|
|
username: ${{ vars.PRIVATE_REGISTRY_USER }}
|
|
password: ${{ secrets.PRIVATE_REGISTRY_PASSWORD }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Trust internal CA in BuildKit container
|
|
run: |
|
|
BUILDER=$(docker ps --filter "name=buildx_buildkit" --format "{{.Names}}" | head -1)
|
|
echo "${{ vars.PRIVATE_REGISTRY_CA_CERT }}" | \
|
|
docker exec -i "$BUILDER" sh -c 'cat >> /etc/ssl/certs/ca-certificates.crt'
|
|
docker restart "$BUILDER"
|
|
sleep 5
|
|
|
|
- name: Build and push image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: telegraf-snmp
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: ${{ vars.PRIVATE_REGISTRY_DOMAIN }}/${{ env.RESULT_IMAGE_NAME }}:latest
|