kamilyon/build

33 lines
908 B
Text
Raw Normal View History

2023-07-24 17:53:43 +00:00
#!/bin/bash
set -euo pipefail
2024-07-29 00:27:23 +00:00
image="localhost/kamilyon:latest"
2023-07-24 17:53:43 +00:00
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"\
2024-07-29 00:27:23 +00:00
--label containers.bootc="1" \
2023-07-24 17:53:43 +00:00
--tag "$image" -
2024-07-29 00:27:23 +00:00
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