fix: buildkitd network + TCP listener for remote driver
Two bugs made the first CI run fail with 'waiting for connection: context deadline exceeded': 1. Container started without --network landed on default bridge, while job containers run on git_default -> name unresolvable, bridge IP unreachable cross-network. 2. moby/buildkit default entrypoint only listens on a unix socket. driver: remote needs TCP. Added --addr tcp://0.0.0.0:8375 and changed endpoint from docker-container://name (only valid for the docker-container driver) to tcp://name:8375. Both verified on the oracle host: buildx remote driver connects, Status running, platforms linux/arm64,v7,v6.
This commit is contained in:
+11
-2
@@ -21,6 +21,14 @@ inputs:
|
|||||||
description: 'Stop the buildkitd container after the job (idle cleanup; container restarts on demand on the next run)'
|
description: 'Stop the buildkitd container after the job (idle cleanup; container restarts on demand on the next run)'
|
||||||
required: false
|
required: false
|
||||||
default: 'true'
|
default: 'true'
|
||||||
|
network:
|
||||||
|
description: 'Docker network for the buildkitd container — MUST match the network the job containers run on, otherwise the name is unresolvable'
|
||||||
|
required: false
|
||||||
|
default: 'git_default'
|
||||||
|
port:
|
||||||
|
description: 'TCP port buildkitd listens on'
|
||||||
|
required: false
|
||||||
|
default: '8375'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
@@ -30,16 +38,17 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
docker ps -a --format '{{.Names}}' | grep -qx '${{ inputs.container_name }}' || \
|
docker ps -a --format '{{.Names}}' | grep -qx '${{ inputs.container_name }}' || \
|
||||||
docker run -d --name ${{ inputs.container_name }} --privileged \
|
docker run -d --name ${{ inputs.container_name }} --privileged \
|
||||||
|
--network ${{ inputs.network }} \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
--label com.centurylinklabs.watchtower.monitor-only=${{ inputs.monitor_only }} \
|
--label com.centurylinklabs.watchtower.monitor-only=${{ inputs.monitor_only }} \
|
||||||
--label dockhand.notify=${{ inputs.dockhand_notify }} \
|
--label dockhand.notify=${{ inputs.dockhand_notify }} \
|
||||||
${{ inputs.image }}
|
${{ inputs.image }} --addr tcp://0.0.0.0:${{ inputs.port }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v4
|
uses: docker/setup-buildx-action@v4
|
||||||
with:
|
with:
|
||||||
driver: remote
|
driver: remote
|
||||||
endpoint: docker-container://${{ inputs.container_name }}
|
endpoint: tcp://${{ inputs.container_name }}:${{ inputs.port }}
|
||||||
|
|
||||||
- name: Stop BuildKit (idle cleanup)
|
- name: Stop BuildKit (idle cleanup)
|
||||||
if: ${{ inputs.cleanup == 'true' && always() }}
|
if: ${{ inputs.cleanup == 'true' && always() }}
|
||||||
|
|||||||
Reference in New Issue
Block a user