Skip to content

Commit 40d3096

Browse files
aconz2sudo-bmitchtianon
committed
add example using .wh. and move opaque example to its section
Co-authored-by: Brandon Mitchell <git@bmitch.net> Co-authored-by: Tianon Gravi <admwiggin@gmail.com> Signed-off-by: Andrew Consroe <aconz2@gmail.com>
1 parent da92727 commit 40d3096

File tree

1 file changed

+40
-20
lines changed

1 file changed

+40
-20
lines changed

layer.md

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -252,32 +252,22 @@ In all other cases, the implementation MUST do the semantic equivalent of the fo
252252
The following is a base layer with several resources:
253253

254254
```text
255-
a/
256-
a/b/
257-
a/b/c/
258-
a/b/c/bar
255+
file1
256+
a/file2
257+
b/
258+
c/file3
259259
```
260260

261-
When the next layer is created, the original `a/b` directory is deleted and recreated with `a/b/c/foo`:
261+
If we then delete `file1`, `file2`, and `b/`, while leaving `file3` and adding `file4, the next layer looks like:
262262

263263
```text
264-
a/
265-
a/.wh..wh..opq
266-
a/b/
267-
a/b/c/
268-
a/b/c/foo
264+
.wh.file1
265+
a/.wh.file2
266+
.wh.b
267+
file4
269268
```
270269

271-
When processing the second layer, `a/.wh..wh..opq` is applied first, before creating the new version of `a/b`, regardless of the ordering in which the whiteout file was encountered.
272-
For example, the following layer is equivalent to the layer above:
273-
274-
```text
275-
a/
276-
a/b/
277-
a/b/c/
278-
a/b/c/foo
279-
a/.wh..wh..opq
280-
```
270+
Note that regardless of the path being deleted, the whiteout file is a regular file in the archive.
281271

282272
Implementations SHOULD generate layers such that the whiteout files appear before sibling directory entries.
283273

@@ -322,6 +312,36 @@ Note that this opaque file will apply to _all_ children, including sub-directori
322312

323313
Implementations SHOULD generate layers using _explicit whiteout_ files, but MUST accept both.
324314

315+
As another example, consider the following base layer:
316+
317+
```text
318+
a/
319+
a/b/
320+
a/b/c/
321+
a/b/c/bar
322+
```
323+
324+
When the next layer is created, the original `a/b` directory is deleted and recreated with `a/b/c/foo`:
325+
326+
```text
327+
a/
328+
a/.wh..wh..opq
329+
a/b/
330+
a/b/c/
331+
a/b/c/foo
332+
```
333+
334+
When processing the second layer, `a/.wh..wh..opq` is applied first, before creating the new version of `a/b`, regardless of the ordering in which the whiteout file was encountered.
335+
For example, the following layer is equivalent to the layer above:
336+
337+
```text
338+
a/
339+
a/b/
340+
a/b/c/
341+
a/b/c/foo
342+
a/.wh..wh..opq
343+
```
344+
325345
Any given image is likely to be composed of several of these Image Filesystem Changeset tar archives.
326346

327347
## Non-Distributable Layers

0 commit comments

Comments
 (0)