* chore: migrate from docker/docker to moby/moby client
Migrates all Docker client usage from github.com/docker/docker to
github.com/moby/moby/client following imgutil's PR #299 migration.
Key changes:
- Updated all DockerClient interfaces to use moby Result types
(ImageHistoryResult, ContainerInspectResult, etc.)
- Migrated to Options pattern for API calls (ImagePullOptions,
ContainerInspectOptions, etc.)
- Updated Result field access patterns (result.Items, result.Info, etc.)
- Fixed platform validation by passing dist.Target directly to
ImagePull instead of string conversion
- Regenerated mocks for moby's APIClient interface
- Updated test assertions for moby's type system changes
- Fixed go.mod dependencies (moby packages now direct)
All tests passing (304 tests across pkg/client, pkg/image, internal/build).
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* chore: migrate acceptance test manager to moby client
Updated acceptance/managers/image_manager.go to use the new moby client API.
Key changes:
- Updated imports from github.com/docker/docker to github.com/moby/moby
- Changed dockerCli type from client.APIClient to *client.Client
- Updated method signatures to use Options pattern:
- Info() now requires client.InfoOptions{} and accesses .Info.OSType
- ImageTag() uses client.ImageTagOptions with Source/Target fields
- ImageInspect() returns Result type, access .InspectResponse field
- ContainerCreate() uses client.ContainerCreateOptions struct
- ContainerStart() uses client.ContainerStartOptions{}
- ContainerKill() uses client.ContainerKillOptions{Signal: "SIGKILL"}
- ContainerRemove() uses client.ContainerRemoveOptions{Force: true}
- ContainerInspect() requires client.ContainerInspectOptions{} and returns Result
- Updated network port types:
- Use network.MustParsePort() to create network.Port values
- Changed from nat.PortSet/PortMap to network.PortSet/PortMap
- Updated PortBinding from nat.PortBinding to network.PortBinding
- Fixed Result type accesses:
- ContainerInspect: access result.Container instead of result directly
- ImageInspect: access result.InspectResponse
- Info: access result.Info.OSType
This completes the migration from docker/docker to moby/moby client across all test code.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* fix: use concrete Client type in acceptance tests
Changed all dockerCli parameter and variable types from client.APIClient
interface to *client.Client concrete type to match the updated helper
functions and managers that now require the concrete type.
Changes:
- Updated global dockerCli variable type
- Updated createStack() and createStackImage() parameter types
- Changed dockertypes.ImageBuildOptions to client.ImageBuildOptions
- Removed unused github.com/docker/docker/api/types import
This fixes compilation errors where the interface type couldn't be
used as the concrete type without type assertion.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* fixing format issues
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* fix: migrate to client.New() and remove deprecated APIs
Updated all docker client initialization to use the new client.New()
function instead of the deprecated NewClientWithOpts(). The new API
enables API version negotiation by default, so WithAPIVersionNegotiation()
is no longer needed.
Changes:
- Replaced all NewClientWithOpts() calls with New()
- Removed WithAPIVersionNegotiation() option (now default behavior)
- Updated cmd/docker_init.go, pkg/client/client.go, and all test files
- Ran go mod tidy to clean up dependencies
Note: internal/build/testdata/fake-lifecycle/phase.go still uses the old
API since it references the legacy github.com/docker/docker/client package
and is built in a separate container context during tests.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* test: skip report tests for pack versions < v0.40.0
The report tests expect the fixture to show Platform API 0.14 and 0.15,
which are only supported in lifecycle 0.21.0+. Pack versions before
v0.40.0 use lifecycle 0.20.x which only supports Platform APIs up to 0.13.
Added PlatformAPI_0_14 feature flag that checks if pack >= v0.40.0.
The report tests now skip when testing with older pack versions that
don't support Platform APIs 0.14, 0.15.
This fixes the acceptance-combo (current, current, previous) test failure
where current pack (with lifecycle 0.21.0) outputs Platform APIs 0.3-0.15,
but the test was incorrectly expecting 0.3-0.13 due to the fixture override
file that was being picked up.
Removed the pack_previous_fixtures_overrides/report_output.txt file as
the override directory approach didn't work correctly for this test case.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* fix: add Platform API 0.14 and 0.15 support
When we updated to lifecycle 0.21.0, we updated the fixture file to
expect Platform APIs 0.14 and 0.15, but forgot to update the
SupportedPlatformAPIVersions in the code.
The pack report command reads from build.SupportedPlatformAPIVersions
to display which Platform APIs are supported, so this was causing a
mismatch between the fixture expectation and the actual output.
Changes:
- Added api.MustParse("0.14") and api.MustParse("0.15") to
SupportedPlatformAPIVersions in internal/build/lifecycle_executor.go
- Removed the PlatformAPI_0_14 feature flag and skip logic from
acceptance tests (no longer needed)
This fixes the acceptance test failures where the fixture expected
Platform APIs up to 0.15 but pack was only reporting up to 0.13.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
---------
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
* Use Docker API version negotiation instead of hardcoded version
Fixes#2464
This change replaces all hardcoded Docker API version 1.38 references
with WithAPIVersionNegotiation(), allowing pack to automatically adapt
to the Docker daemon's supported API version.
Changes:
- Updated main client initialization to use API version negotiation
- Updated SSH Docker client to use API version negotiation
- Updated all test files to use API version negotiation
- Upgraded fake-lifecycle test dependencies from Docker client v1.4.2 (2019) to v28.5.1
- Fixed fake-lifecycle imports and API calls for compatibility with modern Docker client
Benefits:
- Works with modern Docker daemons requiring API 1.44+ (Docker 27+)
- Backward compatible with older Docker versions
- Future-proof - no need to update hardcoded versions
- Solves Windows runner issue without requiring Docker 27 upgrade
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* Update Example_build test to use newer builder with modern lifecycle
The cnbs/sample-builder:noble builder includes a recent lifecycle version
that supports Docker API 1.44+, fixing the test failure on systems with
modern Docker daemons (Docker 27+).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
* Downgrade fake-lifecycle dependencies for Go 1.23 compatibility
Updated fake-lifecycle test module to support Go 1.23.4 (Windows runner):
- Downgraded lifecycle from v0.20.11 to v0.19.3
- Downgraded go-containerregistry from v0.20.6 to v0.19.2
- Set Go requirement to 1.23 (compatible with Go 1.23.4)
- Updated Dockerfile to use golang:1.23 base image
The older versions still support Docker API 1.44+ and work correctly
with modern Docker daemons requiring minimum API version 1.44.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
---------
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This merges `version.go` into `pkg/client/client.go`, which is the
only file that uses the it. Then it moves `cmd/pack/main.go` into
root. Now `go build` produces executable `pack` instead of bogus
`pack` with just `version.go`.
No need to specify `./cmd/pack` while compiling anymore.
The version is injected into client directly without extra files.
Signed-off-by: Anatoli Babenia <anatoli@rainforce.org>
Co-authored-by: Juan Bustamante <bustamantejj@gmail.com>
Implement Pack Manifest commands in support of https://github.com/buildpacks/rfcs/blob/main/text/0124-pack-manifest-list-commands.md
Signed-off-by: Husni Faiz <ahamedhusni73@gmail.com>
Signed-off-by: WYGIN <wygininc@gmail.com>
Signed-off-by: sai kiran <wyginc1@gmail.com>
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
Signed-off-by: Juan Bustamante <juan.bustamante@broadcom.com>
Signed-off-by: Sai Kiran Maggidi <107541780+WYGIN@users.noreply.github.com>
Signed-off-by: Juan Bustamante <bustamantejj@gmail.com>
Co-authored-by: Juan Bustamante <jbustamante@vmware.com>
Co-authored-by: WYGIN <wygininc@gmail.com>
Co-authored-by: sai kiran <wyginc1@gmail.com>
Co-authored-by: Juan Bustamante <juan.bustamante@broadcom.com>
Co-authored-by: Sai Kiran Maggidi <107541780+WYGIN@users.noreply.github.com>
Co-authored-by: Juan Bustamante <bustamantejj@gmail.com>
Before this change, the BuildpackDownloader leaked internal packages
making it unusable as a library.
The primary changes were to move dist and logging package to pkg.
Signed-off-by: Javier Romero <rjavier@vmware.com>
* Rename inspect-image to inspect, and add alias for inspect-image
* Change behavior for inspect-buildpack to look at default registry name in config, rather than deprecated default registry
Signed-off-by: David Freilich <dfreilich@vmware.com>
* Move IsTerminal to internal logging package, to keep it general but not expose it as part of public API
Signed-off-by: David Freilich <dfreilich@vmware.com>
* This command allows users to list, set, and unset a value for a default builder in the pack config.
Signed-off-by: David Freilich <dfreilich@vmware.com>
* Only show experimental buildpack commands if experimental set
* Use Supports instead of SupportsFeature
Signed-off-by: David Freilich <dfreilich@vmware.com>