containers / buildah

A tool that facilitates building OCI images.
https://buildah.io
Apache License 2.0
7.43k stars 784 forks source link

Add --parents option for COPY in Dockerfiles #5557

Open uckelman opened 5 months ago

uckelman commented 5 months ago

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.

TomSweeneyRedHat commented 5 months ago

I believe @mheon is either working on this or looking into this. Matt?

mheon commented 5 months ago

Yep, hoping to get to this over the next few weeks

github-actions[bot] commented 4 months ago

A friendly reminder that this issue had no activity for 30 days.

cyqsimon commented 2 months ago

This is so badly needed with Java projects that involve multiple pom.xml files. Any progress on this?

krmao commented 1 month ago

any more update?