Closed crazy-max closed 6 days ago
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 https://github.com/docker/buildx/blob/04000db8da4b5a1b2c3830cfafb43b02d98c1f5c/controller/pb/path.go#L17
Added integration tests
relates to https://github.com/docker/buildx/pull/1735 needs or closes #2561
When using a remote context or stdin the
LocalPath
andDockerfilePath
are not correct:With this change we set
LocalPath
andDockerfilePath
accordingly if a remote context is used or stdin.