Skip to content

Added build container MAC address support#2620

Open
TIR44 wants to merge 1 commit into
buildpacks:mainfrom
TIR44:feature/build-container-mac-address
Open

Added build container MAC address support#2620
TIR44 wants to merge 1 commit into
buildpacks:mainfrom
TIR44:feature/build-container-mac-address

Conversation

@TIR44

@TIR44 TIR44 commented May 31, 2026

Copy link
Copy Markdown

Summary

  • Added a pack build --mac-address flag and passed it through client.BuildOptions.ContainerConfig.
  • Stored the parsed MAC address on lifecycle options and applied it to Docker NetworkingConfig.EndpointsConfig for the selected build container network.
  • Kept the default path unchanged by only sending NetworkingConfig when a MAC address is configured.

Output

Before

pack build had no way to pass a MAC address to the build container network endpoint.

After

pack build --mac-address 01:23:45:67:89:ab ... validates the address and creates lifecycle containers with that MAC address on the configured network endpoint.

Documentation

  • Should this change be documented?
    • Yes. The new CLI flag should be included in the generated command reference.

Related

Resolves #1779

Tests

  • go test ./internal/build -run '^TestPhaseConfigProvider$' -count=1
  • go test ./internal/commands -run '^TestBuildCommand$' -count=1
  • go test ./pkg/client -run '^TestBuild$' -count=1
  • go test ./internal/commands ./pkg/client -count=1
  • make verify-format
  • golangci-lint run -c golangci.yaml

GitHub checks passed on the latest commit (aa6408f): DCO, CodeQL, build tests on macOS/Linux/Windows, and compatibility acceptance combos.

I also tried go test ./internal/build ./internal/commands ./pkg/client -count=1; internal/commands and pkg/client passed, but the full internal/build package failed locally because Docker is not available at /var/run/docker.sock.

make lint initially failed locally because the pinned golangci-lint binary was built with Go 1.24 while this repo targets Go 1.25.10. Reinstalling the same pinned version with GOTOOLCHAIN=go1.25.10 and then running golangci-lint run -c golangci.yaml passed with 0 issues.

Signed-off-by: TiR <70480807+TIR44@users.noreply.github.com>
@TIR44 TIR44 requested review from a team as code owners May 31, 2026 13:47
@github-actions github-actions Bot added this to the 0.41.0 milestone May 31, 2026
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make specifying a MAC address for the container used for building possible

1 participant