-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
113 lines (98 loc) · 2.97 KB
/
Copy pathjustfile
File metadata and controls
113 lines (98 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Carbon Atomic - Build Commands
# Usage: just <recipe>
# Configuration
# registry := "ghcr.io"
registry := "localhost"
image := "carbon-atomic"
tag := "latest"
image_ref := registry + "/" + image + ":" + tag
toolbox_image := "bootc-toolbox"
toolbox_ref := registry + "/" + toolbox_image + ":" + tag
# List available recipes
default:
@just --list
# Build container image locally
build:
podman build -t {{ image_ref }} .
# Build container image (no cache)
build-fresh:
podman build --no-cache -t {{ image_ref }} .
# Build anaconda-iso installer
build-iso: build
mkdir -p output
sudo podman run \
--rm -it --privileged --pull=newer \
--security-opt label=type:unconfined_t \
-v ./config.toml:/config.toml:ro \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder:latest \
--type anaconda-iso \
--rootfs btrfs \
{{ image_ref }}
@echo ""
@echo "ISO created: output/bootiso/install.iso"
# Build ISO from remote registry (skip local build)
build-iso-remote:
mkdir -p output
sudo podman run \
--rm -it --privileged --pull=newer \
--security-opt label=type:unconfined_t \
-v ./config.toml:/config.toml:ro \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder:latest \
--type anaconda-iso \
--rootfs btrfs \
{{ image_ref }}
# Build qcow2 for VM testing
build-qcow2: build
mkdir -p output
sudo podman run \
--rm -it --privileged --pull=newer \
--security-opt label=type:unconfined_t \
-v ./output:/output \
-v /var/lib/containers/storage:/var/lib/containers/storage \
quay.io/centos-bootc/bootc-image-builder:latest \
--type qcow2 \
--rootfs btrfs \
{{ image_ref }}
@echo ""
@echo "QCOW2 created: output/qcow2/disk.qcow2"
# Push image to registry
push: build
podman push {{ image_ref }}
# Lint Containerfile
lint:
podman run --rm -i hadolint/hadolint < Containerfile || true
# Clean build artifacts
clean:
rm -rf output/
@echo "Cleaned output directory."
# Install user configs (run install.sh)
install:
./install.sh
# Test qcow2 in QEMU
test-vm:
#!/usr/bin/env bash
if [ ! -f output/qcow2/disk.qcow2 ]; then
echo "Run 'just build-qcow2' first"
exit 1
fi
qemu-system-x86_64 \
-M accel=kvm \
-cpu host \
-smp 4 \
-m 8192 \
-bios /usr/share/OVMF/OVMF_CODE.fd \
-drive file=output/qcow2/disk.qcow2,format=qcow2 \
-display gtk
# Build toolbox container image
toolbox-build:
podman build -t {{ toolbox_ref }} -f toolbox/Containerfile toolbox/
# Create toolbox from local image
toolbox-create: toolbox-build
toolbox create --image {{ toolbox_ref }} bootc-dev
# Enter bootc-dev toolbox
toolbox-enter:
toolbox enter bootc-dev