containers / buildah

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

Add --parents option for COPY in Dockerfiles #5557

Open uckelman opened 1 month ago

uckelman commented 1 month 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 1 month ago

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

mheon commented 1 month ago

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