Appending archives to OCI tags
Add an archive to an existing OCI tag
You can append a second archive to an OCI tag that already exists. The archive contains the files and folders you want to add. Anka adds that archive as the next layer on the same tag.
❯ anka push my.tar -t tag http://registry.example.com/v2/repo
-t is required. Without -t, Anka exits before the upload. An OCI tag is an ordered set of layers. The tag must already exist. A later pull applies those layers in manifest order. Anka pulls the first archive, then the archive you appended. A zero-length .wh. file in a later archive removes that file from the VM.
Remove a file with a whiteout
A later archive can also remove a file from an earlier layer. Add a zero-length whiteout file in the same directory. Name it .wh. plus the file name. Anka deletes that file from the final image.
usr/local/bin/.wh.cmake removes usr/local/bin/cmake from the earlier layer. A directory entry named .wh. plus the directory name removes that directory.
anka push writes these whiteout files when a file was deleted in the VM. You can also put them in an archive yourself. Use that archive to patch an existing OCI tag. You do not rebuild the earlier layers.
Show the manifest to see that order. --manifest requires -j.
❯ anka -j registry show http://registry.example.com/v2/repo:tag --manifest