Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes 2 things:
[1] Stop returning nil image config
This can cause some issues in buildkit libs and also yields a cryptic
error on the docker CLI for these non-container targets when the build
is not outputing tot he local dir.
One specific case right now is the dockerui client which drives all the
build targets will panic on the windowscross/zip target when using
windows as a target platform.
In the past this has also caused panics in dockerd and buildkit. These
have been fixed upstream and were considered security issues due to a
frontend being able to panic dockerd, but I don't think we should
continue doing this.
Something to consider in the future is to either replace our usage of
dockerui to drive builds (not great because it is the canonical
implementation for interacting with docker) and also returning a custom
OCI artifact type for these non-container builds OR we could work
upstream to make dockerui support a more generic type.
[2] Set platform on returned llb state
In my case I am trying to run tests from a Mac connecting to a
linux/amd64 machine over SSH.
The windows signing tests end up failing due to the platform missing
from the
llb.State
generated for the the unzipper intermediate state.It tries to run a command in the unzip state but fails due to the
architecture not being compataible.
Before this change
reqToState
is returning anllb.State
without aplatform set on it. Subsequent
.Run()
calls on that state willdefault to the platform of the client (darwin/arm64).
This changes extracts the first (and should be only in the case of our
tests) platform from the returned result and adds that to the returned
llb.State
.