GeezerVison is showing github.com — build: fix localstate for remote context and stdin by crazy-max · Pull Request #2560 · docker/buildx
Conversation
crazy-max
commented
Jun 28, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
relates to #1735
needs or closes #2561
When using a remote context or stdin the LocalPath and DockerfilePath are not correct:
$ docker buildx buildx https://github.com/docker/buildx.git
...
#14 exporting to image
#14 exporting layers done
#14 writing image sha256:d9015ff8b549fee9b8b8100cd168efea32015136c1a0a463dd5f696e130e72fa done
#14 DONE 0.0s
View build details: docker-desktop://dashboard/build/default/default/aav2ix4nw5eky66fw045dkylr
$ jq . ~/.docker/buildx/refs/default/default/aav2ix4nw5eky66fw045dkylr
{
"Target": "default",
"LocalPath": "/home/crazy/foo/bar/https:/github.com/docker/buildx.git",
"DockerfilePath": ""
}
$ docker buildx build -f hello.Dockerfile https://github.com/docker/actions-toolkit.git#:__tests__/fixtures
...
#10 exporting to image
#10 exporting layers done
#10 writing image sha256:9deae3ebca280147d5096bd8858e2a008014cd6cc2e7b33e6307f06cbf11d992 done
#10 DONE 0.0s
View build details: docker-desktop://dashboard/build/default/default/7pnnqpgacnqq98oa1a1h5sz6t
$ jq . ~/.docker/buildx/refs/default/default/7pnnqpgacnqq98oa1a1h5sz6t
{
"Target": "default",
"LocalPath": "/home/crazy/foo/bar/https:/github.com/docker/actions-toolkit.git#:__tests__/fixtures",
"DockerfilePath": "/home/crazy/foo/bar/hello.Dockerfile"
}
$ docker buildx build -f- . < hello.Dockerfile
...
#14 exporting to image
#14 exporting layers done
#14 writing image sha256:d9015ff8b549fee9b8b8100cd168efea32015136c1a0a463dd5f696e130e72fa done
#14 DONE 0.0s
View build details: docker-desktop://dashboard/build/default/default/aav2ix4nw5eky66fw045dkylr
$ jq . ~/.docker/buildx/refs/default/default/w38vcd5fo5cfvfyig77qjec0v
{
"Target": "default",
"LocalPath": "/home/crazy/hello",
"DockerfilePath": "/home/crazy/hello/-"
}
With this change we set LocalPath and DockerfilePath accordingly if a remote context is used or stdin.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
crazy-max
commented
Jun 28, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
When checking Inputs.ContextPath, I found that it is not the same when building through controller:
$ BUILDX_EXPERIMENTAL=1 docker buildx build -f hello.Dockerfile .
...
#10 exporting to image
#10 exporting layers done
#10 writing image sha256:9deae3ebca280147d5096bd8858e2a008014cd6cc2e7b33e6307f06cbf11d992 done
#10 DONE 0.0s
View build details: docker-desktop://dashboard/build/default/default/nb6ivxlwkacfvnxach0m1vg9g
$ jq . ~/.docker/buildx/refs/default/default/nb6ivxlwkacfvnxach0m1vg9g
{
"ContextPath": "/home/crazy/hello",
"Target": "default",
"LocalPath": "/home/crazy/hello",
"DockerfilePath": "/home/crazy/hello/hello.Dockerfile"
}
Without controller:
$ docker buildx build -f hello.Dockerfile .
...
#11 exporting to image
#11 exporting layers done
#11 writing image sha256:9deae3ebca280147d5096bd8858e2a008014cd6cc2e7b33e6307f06cbf11d992 done
#11 DONE 0.0s
View build details: docker-desktop://dashboard/build/default/default/szmtd9nf4urns5872py50l9pm
$ jq . ~/.docker/buildx/refs/default/default/szmtd9nf4urns5872py50l9pm
{
"ContextPath": ".",
"Target": "default",
"LocalPath": "/home/crazy/hello",
"DockerfilePath": "/home/crazy/hello/hello.Dockerfile"
}
Seems related to
|
options.ContextPath, err = filepath.Abs(options.ContextPath) |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
crazy-max
changed the title
build: fix localstate for remote context
build: fix localstate for remote context and stdin
Jun 28, 2024
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 5, 2024
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|