FROM busybox:1.36.1
RUN mkdir /tmp/dir
RUN touch /tmp/dir/file
RUN rm -rf /tmp/dir ; touch /tmp/dir
Squashing this image will produce a broken image containing both /tmp/dir/file and /tmp/dir (second one is a regular file, not a directory). This problem was solved earlier for symlinks (#120 ?), but it is exactly the same for all other types of files
And here is a similar scenario for marker files:
FROM busybox:1.36.1
RUN mkdir /tmp/dir
RUN touch /tmp/dir/file
RUN rm /tmp/dir/file
RUN rm -rf /tmp/dir ; touch /tmp/dir
Here we will have both /tmp/dir/.wh.file and /tmp/dir. I guess this situation is similar to #122
The correct solution would be something like this:
- Memorize all files we already added
- Memorize all directories we already added
- When adding a new file, check whether parent directory already exists or not; if it does and it is not actually a directory, skip the file; otherwise, add the file as normal
Squashing this image will produce a broken image containing both
/tmp/dir/fileand/tmp/dir(second one is a regular file, not a directory). This problem was solved earlier for symlinks (#120 ?), but it is exactly the same for all other types of filesAnd here is a similar scenario for marker files:
Here we will have both
/tmp/dir/.wh.fileand/tmp/dir. I guess this situation is similar to #122The correct solution would be something like this: