Open chris13524 opened 3 years ago
For now I think you're better off using the custom
builder to invoke Docker directly. Our docker
builders assume a relatively well-formed Dockerfile
as they parse the Dockerfile
to obtain information such as from ADD
and COPY
. I'm honestly not sure what we can do in this situation.
I will use the custom builder, thanks!
cargo-wharf-frontend
BuildKit frontend as an alternative to the regular Dockerfile syntax. The test cases it added also are testing non-Dockerfile syntax.Iterating further on this issue, I'm thinking that #5441 should not have been merged. Firstly, it only skips validation for readCopyCmdsFromDockerfile()
and not for the function that is causing my error, filterUnusedBuildArgs()
. But ultimately I think that if Skaffold is expecting to be able to parse the file as a Dockerfile and extract valuable path information for usage, then it should not accept a "Dockerfile" with custom syntax at all. So instead of skipping validation it should emit an error telling the user to use the custom
builder and provide their pathing information manually. This is because in the case of something like cargo-wharf, the "Dockerfile" (actually Cargo.toml) doesn't contain any viable pathing information anyway.
Maybe it would be possible to hook directly into BuildKit to reliably determine the source paths used during the build?
@chris13524 thanks for the suggestions! I think this needs to be discussed a bit further within the team, so I'll bring up your points and see what kind of conclusion we can come to around this :)
Maybe it would be possible to hook directly into BuildKit to reliably determine the source paths used during the build?
There is a new proposal for a BuildKit feature here that I think would address this idea/issue: https://github.com/moby/buildkit/issues/2269
Expected behavior
Arbitrary syntax should be valid when the
# syntax
directive is enabled.Actual behavior
Given a
Cargo.toml
like this:And this
skaffold.yaml
:You get this error:
If you comment out
env = { RUST_LOG = "info" }
fromCargo.toml
then runskaffold run
then the build will work.I believe this test case was missed by #5441.
I'm not familiar with the code at all, but it seems like some actual parsing of the file contents is being done prior to the syntax directive being checked.
Information