32 lines
908 B
Bash
Executable file
32 lines
908 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
image="localhost/kamilyon:latest"
|
|
|
|
podman build --net host --security-opt label=disable --cap-add all -f Containerfile --tag "$image" .
|
|
|
|
commit=$(podman run --rm "$image" ostree rev-parse --single)
|
|
diffid=$(podman inspect "$image" | jq -r '.[0].RootFS.Layers[-1]')
|
|
|
|
echo "FROM $image" | podman build \
|
|
--label ostree.commit="$commit" \
|
|
--label ostree.final-diffid="$diffid"\
|
|
--label containers.bootc="1" \
|
|
--tag "$image" -
|
|
|
|
sudo podman run \
|
|
--cap-add CAP_SYS_ADMIN \
|
|
--rm \
|
|
-it \
|
|
--privileged \
|
|
--pull=newer \
|
|
--security-opt label=type:unconfined_t \
|
|
-v $(pwd)/config.toml:/config.toml:ro \
|
|
-v $(pwd)/output:/output \
|
|
-v /var/lib/containers/storage:/var/lib/containers/storage \
|
|
quay.io/centos-bootc/bootc-image-builder:latest \
|
|
--type qcow2 \
|
|
--local kamilyon:latest \
|
|
--log-level debug \
|
|
--rootfs xfs
|