buildah
buildah copied to clipboard
Add --parents option for COPY in Dockerfiles
Description
Docker added a --parents option to the Dockerfile COPY command last year:
https://github.com/moby/moby/issues/35639 https://github.com/moby/buildkit/pull/3001 https://docs.docker.com/reference/dockerfile/#copy---parents
buildah doesn't know how to handle COPY --parents so errors out on Dockerfiles which use it.
I'm seeing increasing use of --parents in Dockerfiles I have to deal with, which is making it hard to use podman/buildah instead of Docker. --parents is also a genuinely useful option on its own, so would be nice to have not just for compatibility.
It's quite useful to be able to do things like
COPY --parents src/**/pyproject.toml src/**/poetry.lock /app/
and maintain the directory structure in the destination without having to list out every single file.
I believe @mheon is either working on this or looking into this. Matt?
Yep, hoping to get to this over the next few weeks
A friendly reminder that this issue had no activity for 30 days.
This is so badly needed with Java projects that involve multiple pom.xml files. Any progress on this?
any more update?
bump this is a good idea
any news? :)
Could you give me a sample Containerfile that would use this?
@rhatdan Of course. This sort of thing is useful in a workspace of any language where nested manifest files are involved.
Here is an example in Rust (they are working on toolchain support for building only dependencies without project source, but that's not our concern).
Alternatively, here is an example with Maven (which has existing toolchain support). To optimise layer caching, you would want something like this:
COPY --parents **/pom.xml ./
RUN mvn dependency:go-offline
Without --parents, you'd have to manually path to every sub-manifest.
https://github.com/larixer/docker-js-monorepo has some pretty good examples as well.
Any news on this? it would be really helpful to have --parents supported
@Honny1 might have time to work on this?
I will take a look.