diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..c1d18d8a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +_out diff --git a/README.md b/README.md index fdc82dd9..fac84d9f 100644 --- a/README.md +++ b/README.md @@ -32,56 +32,14 @@ Any Linux system installed on it (eg. Ubuntu should be enough) ### Netboot server -Write configuration: +Start matchbox with prebuilt Talos image for Cozystack: ``` -mkdir -p matchbox/assets matchbox/groups matchbox/profiles - -wget -O matchbox/assets/initramfs.xz \ - https://github.com/aenix-io/cozystack/releases/download/v0.0.1/initramfs-metal-amd64.xz -wget -O matchbox/assets/vmlinuz \ - https://github.com/aenix-io/cozystack/releases/download/v0.0.1/kernel-amd64 - - -cat > matchbox/groups/default.json < matchbox/profiles/default.json < images/installer.tag + +image-talos: + test -f ../../../_out/assets/installer-amd64.tar || make talos-installer + docker load -i ../../../_out/assets/installer-amd64.tar + docker tag ghcr.io/siderolabs/installer:$(TALOS_VERSION) ghcr.io/aenix-io/cozystack/talos:$(TALOS_VERSION) + docker push ghcr.io/aenix-io/cozystack/talos:$(TALOS_VERSION) + +image-matchbox: + test -f ../../../_out/assets/kernel-amd64 || make talos-kernel + test -f ../../../_out/assets/initramfs-metal-amd64.xz || make talos-initramfs + docker buildx build -f images/matchbox/Dockerfile ../../.. \ + --provenance false \ + --tag $(REGISTRY)/matchbox:$(TAG) \ + --cache-from type=registry,ref=$(REGISTRY)/matchbox:$(TAG) \ + --cache-to type=inline \ + --metadata-file images/matchbox.json \ + --push=$(PUSH) \ + --load=$(LOAD) + echo "$(REGISTRY)/matchbox:$(TAG)" > images/matchbox.tag + +assets: talos-iso + +talos-initramfs talos-kernel talos-installer talos-iso: + cat images/talos/profiles/$(subst talos-,,$@).yaml | docker run --rm -i -v $${PWD}/../../../_out/assets:/out -v /dev:/dev --privileged "ghcr.io/siderolabs/imager:$(TALOS_VERSION)" - diff --git a/packages/core/talos/hack/gen-profiles.sh b/packages/core/installer/hack/gen-profiles.sh similarity index 94% rename from packages/core/talos/hack/gen-profiles.sh rename to packages/core/installer/hack/gen-profiles.sh index 3423ee58..409e0f28 100755 --- a/packages/core/talos/hack/gen-profiles.sh +++ b/packages/core/installer/hack/gen-profiles.sh @@ -6,7 +6,7 @@ PROFILES="initramfs kernel iso installer" FIRMWARES="amd-ucode amdgpu-firmware bnx2-bnx2x i915-ucode intel-ice-firmware intel-ucode qlogic-firmware" EXTENSIONS="drbd zfs" -mkdir -p profiles +mkdir -p images/talos/profiles printf "fetching talos version: " talos_version=${1:-$(skopeo --override-os linux --override-arch amd64 list-tags docker://ghcr.io/siderolabs/imager | jq -r '.Tags[]' | grep '^v[0-9]\+.[0-9]\+.[0-9]\+$' | sort -V | tail -n 1)} @@ -31,8 +31,8 @@ for extension in $EXTENSIONS; do done for profile in $PROFILES; do - echo "writing profile profiles/$profile.yaml" - cat > profiles/$profile.yaml < images/talos/profiles/$profile.yaml <