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)'
|
||||
required: false
|
||||
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:
|
||||
using: 'composite'
|
||||
@@ -30,16 +38,17 @@ runs:
|
||||
run: |
|
||||
docker ps -a --format '{{.Names}}' | grep -qx '${{ inputs.container_name }}' || \
|
||||
docker run -d --name ${{ inputs.container_name }} --privileged \
|
||||
--network ${{ inputs.network }} \
|
||||
--restart unless-stopped \
|
||||
--label com.centurylinklabs.watchtower.monitor-only=${{ inputs.monitor_only }} \
|
||||
--label dockhand.notify=${{ inputs.dockhand_notify }} \
|
||||
${{ inputs.image }}
|
||||
${{ inputs.image }} --addr tcp://0.0.0.0:${{ inputs.port }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v4
|
||||
with:
|
||||
driver: remote
|
||||
endpoint: docker-container://${{ inputs.container_name }}
|
||||
endpoint: tcp://${{ inputs.container_name }}:${{ inputs.port }}
|
||||
|
||||
- name: Stop BuildKit (idle cleanup)
|
||||
if: ${{ inputs.cleanup == 'true' && always() }}
|
||||
|
||||
Reference in New Issue
Block a user