Union mount
Union mounting is a way of combining multiple file systems into one that appears to contain their combined contents.
Follow my journey as I learn Golang by exploring popular repositories like docker/mody/buildah and, inspired by what I’ve learned, create my very own container-building tool.
Each blog post breaks down the process into easy steps, making Golang and containerization accessible for beginners.
Code is located here: https://github.com/pkorzh/container-build-tool
Usage example:
# this will copy the nginx:latest image into /var/tmp/nginx dir in OCI format
skopeo copy docker://nginx oci:/var/tmp/nginx
cbt from oci-layout:/var/tmp/nginx
# configure image
cbt config nginx --os linux --arch amd64
# create app layer
APP_LAYER_DIR=~/.cbt/nginx/layers/app
mkdir -p $APP_LAYER_DIR
# add content to app layer
mkdir -p $APP_LAYER_DIR/usr/share/nginx/html
echo '<h1>hello world</h1>' >> $APP_LAYER_DIR/usr/share/nginx/html/index.html
cbt build nginx oci-archive:nginx.tar.gz --layers app