docker / docker/buildx

Support extracting remote tarballs when used as named contexts with Bake

Open
#3,383 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/bake kind/enhancement
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

Contributing guidelines
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.