containerd / nerdctl

contaiNERD CTL - Docker-compatible CLI for containerd, with support for Compose, Rootless, eStargz, OCIcrypt, IPFS, ...
Apache License 2.0
8.15k stars 607 forks source link

Support `.containerignore` #3595

Closed benatkin closed 5 days ago

benatkin commented 2 weeks ago

What is the problem you're trying to solve

Confusion about the difference between Docker and OCI images, consistency with Podman and Containerfile

OCI Images have been a thing for a long time, but people think it's a Docker thing, when it is not only a Docker thing. Besides nerdctl, OCI images are run in MicroVMs.

Describe the solution you'd like

When calling BuildKit detect if .dockerignore doesn't exist but .containerignore exists, copy or rename .containerignore to .dockerignore and delete or rename it back after it completes or fails.

Consider warning if there is a mismatch between Dockerfile / .dockerignore and Containerfile / .containerignore.

Additional context

BuildKit doesn't support .containerignore - the issue was closed with "No interest." https://github.com/moby/buildkit/issues/3108

apostasie commented 1 week ago

Describe the solution you'd like

When calling BuildKit detect if .dockerignore doesn't exist but .containerignore exists, copy or rename .containerignore to .dockerignore and delete or rename it back after it completes or fails.

Unfortunately that would wreak concurrent builds.

Unless buildkit implements it, I am not sure there is a good solution here.

Zheaoli commented 5 days ago

I think we will not implement it until the buildkit do the same thing