Expand description
APIs for creating container images from OSTree commits
StructsΒ§
- Export
Options - Configuration for tar export.
- Ostree
TarWriter π
ConstantsΒ§
- BARE_
SPLIT_ XATTRS_ MODE - The repository mode generated by a tar export stream.
- BUF_
CAPACITY π - A decently large buffer, as used by e.g. coreutils
cat. System calls are expensive. - OSTREEDIR π
- OSTREEREF π
- REPO_
CONFIG π - The base repository configuration that identifies this is a tar export.
- SECURITY_
SELINUX_ πXATTR - Then derive a string version (without the NUL) from the above.
- SECURITY_
SELINUX_ πXATTR_ C - The SELinux xattr. Because the ostree xattrs require an embedded NUL, we store that version as a constant.
- SYSROOT π
- TAR_
PATH_ πPREFIX_ V0 - In v0 format, we use this relative path prefix. I think I chose this by looking
at the current Fedora base image tar stream. However, several others donβt do
this and have paths be relative by simply omitting
./, i.e. the tar stream containsusr/bin/bashand not./usr/bin/bash. The former looks cleaner to me, so in v1 we drop it.
FunctionsΒ§
- append_
pax_ πxattrs - Append xattrs to the tar stream as PAX extensions, excluding security.selinux which doesnβt become visible in container runtimes anyway. https://github.com/containers/storage/blob/0d4a8d2aaf293c9f0464b888d932ab5147a284b9/pkg/archive/archive.go#L85
- export_
chunk π - Output a chunk to a tar stream.
- export_
commit - Export an ostree commit to an (uncompressed) tar archive stream.
- export_
final_ πchunk - Output the last chunk in a chunking.
- impl_
export π - Recursively walk an OSTree commit and generate data into a
[tar::Builder]which contains all of the metadata objects, as well as a hardlinked stream that looks like a checkout. Extended attributes are stored specially out of band of tar so that they can be reliably retrieved. - impl_
raw_ πexport - Export an ostree commit as a βrawβ tar stream - just the filesystem content
with
/usr/etc->/etcremapping, without ostree repository structure. - map_
path π - Convert /usr/etc back to /etc
- map_
path_ πinner - Convert
fromtoto - map_
path_ πv1 - Convert usr/etc back to etc for the tar stream.
- object_
path π - path_
equivalent_ πfor_ tar - Given two paths, which may be absolute (starting with /) or
start with
./, return true if they are equal after removing those prefixes. This is effectively βwould these paths be equalβ when processed as a tar entry. - path_
for_ πtar_ v1 - Chunked (or version 1) tar streams donβt have a leading
./. - raw_
export_ πdir - Recursively export a directory for raw export mode.
- reinject_
detached_ πmetadata - Process an exported tar stream, and update the detached metadata.
- symlink_
is_ πdenormal - Check for βdenormalβ symlinks which contain β//β
- tar_
append_ πdefault_ data - unmap_
path π - Convert etc to usr/etc Note: no leading β/β or β./β
- update_
detached_ metadata - Replace the detached metadata in an tar stream which is an export of an OSTree commit.
- v1_
xattrs_ πobject_ path - write_
chunk π - Implementation of chunk writing, assumes that the preliminary structure has been written to the tar stream.