Support extracting remote tarballs when used as named contexts with Bake
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 4.5k
- Forks
- 682
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 29
Description
Contributing guidelines
- I've read the contributing guidelines and wholeheartedly agree
I've found a bug and checked that ...
- ... the documentation does not mention anything about my problem
- ... there are no open or closed issues that are related to my problem
Description
When using a remote tarball (e.g. GitHub release archives) as a context or contexts entry in bake, the tarball is downloaded but not extracted.
Expected behaviour
Remote tarballs should be extracted and the contents should be used as a context. 1
Have Bake detect and extract tarball archives so that tarballs can be used as contexts directly. Similar to how build handles it:
Actual behaviour
The tarball is downloaded but not extracted.
Buildx version
github.com/docker/buildx v0.26.1-desktop.1 532a478c2ea39e2d0eb40ad2e3f6bec57df4c8af
Docker info
Builders list
docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
container docker-container
\_ container0 \_ desktop-linux inactive
default docker
\_ default \_ default running v0.23.2 linux/amd64 (+2), linux/arm64, linux/ppc64le, linux/s390x, (2 more)
desktop-linux* docker
\_ desktop-linux \_ desktop-linux running v0.23.2 linux/amd64 (+2), linux/arm64, linux/ppc64le, linux/s390x, (2 more)
Configuration
target "default" {
contexts = {
buildx = "https://github.com/docker/buildx/archive/refs/tags/v0.27.0.tar.gz"
}
dockerfile-inline = <<EOT
FROM alpine:3.22
COPY --from=buildx . .
RUN ls -l && stop
EOT
}
Build logs
Additional info
-
Note: GitHub release tarballs 302-redirect to a codeload.github.com URL.
-
Even using the codeload URL directly still results in just the compressed tarball being available.
-
It looks like Bake just sets the context state to the file rather than extracting it:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing build/opt.go lines 399-422 with the Bake paths in bake/bake.go at lines 1291-1292 and 1305-1310. Reproduce the configuration using the remote tarball context, then follow how the context is assigned. Done means Bake extracts the remote tarball and makes its contents available to the build context, matching build behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100