Skip to content

Conversation

@Ajay-Satish-01
Copy link

Summary

Added --docker-host flag support to pack builder create command to enable compatibility with alternative container runtimes like Podman. This flag was already available in pack build but was missing from builder creation, causing issues when users needed to specify custom Docker daemon endpoints.

The implementation adds the --docker-host flag with the same functionality and description as the existing flag in pack build, allowing users to:

  • Specify custom Docker daemon addresses (TCP, Unix socket)
  • Use --docker-host=inherit to inherit from the DOCKER_HOST environment variable
  • Maintain compatibility with Podman and other Docker-compatible runtimes

Output

Before

$ pack builder create buildpacks/builder:glibc --config ./builder.toml --docker-host=inherit
Error: unknown flag: --docker-host
Usage:
  pack builder create <image-name> --config <builder-config-path> [flags]

After

$ pack builder create buildpacks/builder:glibc --config ./builder.toml --docker-host=inherit
Pro tip: use --targets flag OR [[targets]] in builder.toml to specify the desired platform
# Command proceeds successfully (no unknown flag error)
$ pack builder create --help
...
      --docker-host string         Address to docker daemon that will be exposed to the build container.
                                   If not set (or set to empty string) the standard socket location will be used.
                                   Special value 'inherit' may be used in which case DOCKER_HOST environment variable will be used.
                                   This option may set DOCKER_HOST environment variable for the build container if needed.
...

Resolves

Fixes #2350

@Ajay-Satish-01 Ajay-Satish-01 requested review from a team as code owners July 1, 2025 07:34
@github-actions github-actions bot added this to the 0.39.0 milestone Jul 1, 2025
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Jul 1, 2025
@jjbustamante
Copy link
Member

Hi @Ajay-Satish-01

Thanks a lot for this PR!!!

The implementation for adding the new --docker-host flag to the pack builder create command is fine, but I think we are missing the ability to target the underlying error.

From the issue, I noticed this:

ERROR: invalid run image config: failed to fetch image: initializing source docker://localhost/bellsoft/buildpacks.alpaquita-run:glibc: pinging container registry localhost: Get "https://localhost/v2/": dial tcp [::1]:443: connect: connection refused

Which makes me think the error came from the image.Fetcher when we try to access the daemon, in this case. Your PR is passing through the configuration to the builder create command, but we are not using it. The difference between pack build and pack builder create or pack buildpack package is that when creating the builder or the buildpack pack is not spinning up a container, we build the OCI artifact on disk. Then we save it in the daemon or the OCI registry. If you check what we do with docker-host during pack build you will find we configure the docker run command to use it, but with builder create we don't run a container.

We need to check our Fetch implementation when the daemon is actually Podman. I think that's the missing part of your PR. What to do with docker-host value when fetching from daemon in Podman.

Copy link
Member

@jjbustamante jjbustamante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is looking good! 🚀 but I think we still need to address the underlying error

@Ajay-Satish-01
Copy link
Author

PR is looking good! 🚀 but I think we still need to address the underlying error

Thanks for the detailed explanation. Will look into it and get back if I have any questions.

@github-actions github-actions bot added type/chore Issue that requests non-user facing changes. and removed type/chore Issue that requests non-user facing changes. labels Jul 1, 2025
@github-actions github-actions bot added type/chore Issue that requests non-user facing changes. and removed type/chore Issue that requests non-user facing changes. labels Jul 1, 2025
@github-actions github-actions bot added the type/chore Issue that requests non-user facing changes. label Jul 21, 2025
Ajay-Satish-01 and others added 5 commits July 20, 2025 19:58
…dpacks#2412)

Bumps [buildpacks/github-actions](https://github.com/buildpacks/github-actions) from 5.9.1 to 5.9.2.
- [Release notes](https://github.com/buildpacks/github-actions/releases)
- [Commits](buildpacks/github-actions@v5.9.1...v5.9.2)

---
updated-dependencies:
- dependency-name: buildpacks/github-actions
  dependency-version: 5.9.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Ajay-Satish-01 <[email protected]>
Signed-off-by: Ajay-Satish-01 <[email protected]>
Signed-off-by: Ajay-Satish-01 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

other subcommands do not work with podman

2 participants