Repository navigation
fix: propagate DOCKER_HOST to MCP gateway for ARC/dind runners - #31670
Conversation
dfb0a78 to
bd1f4b7
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR improves portability of the MCP gateway startup on self-hosted runners by deriving the Docker socket mount and group ID from DOCKER_HOST (instead of hardcoding /var/run/docker.sock) and propagating DOCKER_HOST into the gateway container. It also introduces a new (separately-scoped) feature flag to emit GHES-compatible artifact action pins.
Changes:
- Resolve Docker socket path from
DOCKER_HOST, compute socket GID from the resolved path, and mount that path into the MCP gateway container; also passDOCKER_HOSTthrough to the container. - Add
ghes-artifact-compatfeature flag to pinactions/{upload,download}-artifactto v3.x when enabled. - Add embedded v3.x artifact pins to the action pin dataset and test the compat behavior.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/mcp_setup_generator.go | Derives DOCKER_SOCK_PATH from DOCKER_HOST, uses it for socket GID detection and docker socket mount, and propagates DOCKER_HOST to the container. |
| pkg/workflow/mcp_setup_generator_test.go | Updates expectations for resolved socket path and DOCKER_HOST propagation. |
| pkg/workflow/compiler.go | Enables GHES artifact compat mode via feature flag during compilation. |
| pkg/workflow/action_pins.go | Adds GHES artifact compat pin selection logic and global toggle. |
| pkg/workflow/action_pins_test.go | Adds tests validating GHES compat behavior and pin presence. |
| pkg/constants/feature_constants.go | Introduces ghes-artifact-compat feature flag constant and docs. |
| pkg/actionpins/data/action_pins.json | Adds v3.x pins for upload/download artifact actions. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
bd1f4b7 to
ded5994
Compare
This comment has been minimized.
This comment has been minimized.
|
@copilot recompile |
Recompiled — all 219 workflow lock files have been updated and pushed in commit |
|
@copilot review modifed code in .lock.yml from a security and shell sec POV |
Security review of the modified shell snippet in all 219 Shell snippet added to every lock file: case "${DOCKER_HOST:-}" in
unix://* ) DOCKER_SOCK_PATH="${DOCKER_HOST#unix://}" ;;
/* ) DOCKER_SOCK_PATH="$DOCKER_HOST" ;;
* ) DOCKER_SOCK_PATH=/var/run/docker.sock ;;
esac
DOCKER_SOCK_GID=$(stat -c '%g' "$DOCKER_SOCK_PATH" 2>/dev/null || echo '0')
export MCP_GATEWAY_DOCKER_COMMAND='... -v '"${DOCKER_SOCK_PATH}"':/var/run/docker.sock ...'Analysis:
Threat model note: No changes needed. |
Resolve the Docker socket path from DOCKER_HOST instead of hardcoding /var/run/docker.sock. Pass DOCKER_HOST through to the gateway container so it can use custom socket paths. Auto-detect the socket GID from the resolved path so --group-add works correctly on ARC/dind setups. Ref #28888
331e57f to
30788ea
Compare
|
@copilot build build-wasm and lint o |
|
LGTM. Let's wait for the wasm refresh and merge. |
All 3 are unrelated to the |
Resolves the Docker socket path from
DOCKER_HOSTinstead of hardcoding/var/run/docker.sock. PassesDOCKER_HOSTto the gateway container and auto-detects socket GID from the resolved path.Ref #28888