Skip to content

Commit 49abdaf

Browse files
committed
Update BuildKit endpoint configuration to use port input and adjust related documentation
1 parent fc7b5ba commit 49abdaf

File tree

6 files changed

+15
-8
lines changed

6 files changed

+15
-8
lines changed

.github/workflows/example-audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: docker/setup-buildx-action@v3
1919
with:
2020
driver: remote
21-
endpoint: ${{ steps.buildcage.outputs.endpoint }}
21+
endpoint: tcp://localhost:${{ steps.buildcage.outputs.port }}
2222

2323
- name: Create test Dockerfile
2424
run: |

.github/workflows/example-restrict.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: docker/setup-buildx-action@v3
2020
with:
2121
driver: remote
22-
endpoint: ${{ steps.buildcage.outputs.endpoint }}
22+
endpoint: tcp://localhost:${{ steps.buildcage.outputs.port }}
2323

2424
- name: Create test Dockerfile
2525
run: |

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,13 @@ The internal proxy server inspects the SNI field (for HTTPS) or the Host header
116116
| `proxy_mode` | No | `restrict` | Operation mode (`audit` / `restrict`) |
117117
| `allowed_http_domains` | No | empty | Allowed HTTP domains (comma-separated) |
118118
| `allowed_https_domains` | No | empty | Allowed HTTPS domains (comma-separated) |
119+
| `port` | No | `1234` | BuildKit endpoint port on localhost |
119120

120121
**Output:**
121122

122123
| Name | Description |
123124
|------|-------------|
124-
| `endpoint` | BuildKit endpoint to pass to `docker buildx create --driver remote` |
125+
| `port` | BuildKit endpoint port |
125126

126127
### Report
127128

@@ -154,7 +155,7 @@ jobs:
154155
uses: docker/setup-buildx-action@v3
155156
with:
156157
driver: remote
157-
endpoint: ${{ steps.buildcage.outputs.endpoint }}
158+
endpoint: tcp://localhost:${{ steps.buildcage.outputs.port }}
158159
159160
- name: Build
160161
uses: docker/build-push-action@v6

setup/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ inputs:
2222
description: "Comma-separated allowed HTTPS domains"
2323
required: false
2424
default: ''
25+
port:
26+
description: "BuildKit endpoint port on localhost"
27+
required: false
28+
default: '1234'
2529

2630
outputs:
27-
endpoint:
28-
description: "BuildKit endpoint for docker buildx create --driver remote"
31+
port:
32+
description: "BuildKit endpoint port"
2933

3034
runs:
3135
using: node24

setup/compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services:
33
image: ${BUILDCAGE_IMAGE:-ghcr.io/dash14/buildcage}:${BUILDCAGE_VERSION:-latest}
44
privileged: true
55
ports:
6-
- "1234:1234"
6+
- "${PORT:-1234}:1234"
77
environment:
88
- PROXY_MODE=${PROXY_MODE:-restrict}
99
- ALLOWED_HTTP_DOMAINS=${ALLOWED_HTTP_DOMAINS:-}

setup/main.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ execFileSync(
2121
ALLOWED_HTTPS_DOMAINS: process.env.INPUT_ALLOWED_HTTPS_DOMAINS || "",
2222
BUILDCAGE_IMAGE: process.env.INPUT_BUILDCAGE_IMAGE || "ghcr.io/dash14/buildcage",
2323
BUILDCAGE_VERSION: process.env.INPUT_BUILDCAGE_VERSION || "latest",
24+
PORT: process.env.INPUT_PORT || "1234",
2425
},
2526
}
2627
);
2728

2829
// Set action output
29-
appendFileSync(process.env.GITHUB_OUTPUT, "endpoint=tcp://localhost:1234\n");
30+
const port = process.env.INPUT_PORT || "1234";
31+
appendFileSync(process.env.GITHUB_OUTPUT, `port=${port}\n`);

0 commit comments

Comments
 (0)