Skip to content

Commit 7eda1bc

Browse files
feat(ci): rootless CI [Backport stable-f44] (#2507)
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
1 parent a0d7352 commit 7eda1bc

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

.github/workflows/reusable-build.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ jobs:
7373
uses: ublue-os/container-storage-action@25e05be4948f77746938687877829d15c5038036
7474
continue-on-error: true
7575
with:
76-
target-dir: /var/lib/containers
7776
mount-opts: compress-force=zstd:2
7877
loopback-free: '1'
7978

@@ -180,7 +179,7 @@ jobs:
180179
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
181180
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
182181
run: |
183-
sudo -E $(command -v just) \
182+
$(command -v just) \
184183
repo_organization="${{ github.repository_owner }}" \
185184
build \
186185
--image "${MATRIX_BASE_NAME}" \
@@ -193,7 +192,7 @@ jobs:
193192
shell: bash
194193
id: cache-perms
195194
run: |
196-
sudo chmod 777 --recursive /var/tmp/buildah-cache-0
195+
chmod 777 --recursive /var/tmp/buildah-cache-${UID}
197196
198197
- name: Write new DNF package cache
199198
if: steps.setup-cache.outputs.allow_cache_write == 'true'
@@ -211,7 +210,7 @@ jobs:
211210
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
212211
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
213212
run: |
214-
sudo -E $(command -v just) rechunk \
213+
$(command -v just) rechunk \
215214
--image "${MATRIX_BASE_NAME}" \
216215
--tag "${MATRIX_STREAM_NAME}" \
217216
--flavor "${MATRIX_IMAGE_FLAVOR}"
@@ -230,7 +229,7 @@ jobs:
230229
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
231230
SYFT_CMD: ${{ steps.setup-syft.outputs.cmd }}
232231
run: |
233-
sudo -E $(command -v just) gen-sbom \
232+
$(command -v just) gen-sbom \
234233
--image "${MATRIX_BASE_NAME}" \
235234
--tag "${MATRIX_STREAM_NAME}" \
236235
--flavor "${MATRIX_IMAGE_FLAVOR}" \
@@ -244,7 +243,7 @@ jobs:
244243
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
245244
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
246245
run: |
247-
sudo -E $(command -v just) secureboot \
246+
$(command -v just) secureboot \
248247
--image "${MATRIX_BASE_NAME}" \
249248
--tag "${MATRIX_STREAM_NAME}" \
250249
--flavor "${MATRIX_IMAGE_FLAVOR}"
@@ -257,7 +256,7 @@ jobs:
257256
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
258257
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
259258
run: |
260-
sudo -E $(command -v just) export-oci \
259+
$(command -v just) export-oci \
261260
--image "${MATRIX_BASE_NAME}" \
262261
--tag "${MATRIX_STREAM_NAME}" \
263262
--flavor "${MATRIX_IMAGE_FLAVOR}"
@@ -283,7 +282,7 @@ jobs:
283282
MATRIX_STREAM_NAME: ${{ matrix.stream_name }}
284283
MATRIX_IMAGE_FLAVOR: ${{ matrix.image_flavor }}
285284
run: |
286-
sudo -E $(command -v just) disk-image \
285+
$(command -v just) disk-image \
287286
--image "${MATRIX_BASE_NAME}" \
288287
--tag "${MATRIX_STREAM_NAME}" \
289288
--flavor "${MATRIX_IMAGE_FLAVOR}" \
@@ -332,7 +331,7 @@ jobs:
332331
ALIAS_TAGS: ${{ steps.generate-tags.outputs.alias_tags }}
333332
run: |
334333
set -eoux pipefail
335-
sudo -E $(command -v just) tag-images \
334+
$(command -v just) tag-images \
336335
--image "${IMAGE_NAME}" \
337336
--default-tag "${MATRIX_STREAM_NAME}" \
338337
--tags "${ALIAS_TAGS}"
@@ -369,7 +368,7 @@ jobs:
369368
run: |
370369
set -euox pipefail
371370
372-
sudo -E $(command -v just) push-image \
371+
$(command -v just) push-image \
373372
--image "${MATRIX_BASE_NAME}" \
374373
--tag "${MATRIX_STREAM_NAME}" \
375374
--flavor "${MATRIX_IMAGE_FLAVOR}" \
@@ -409,7 +408,7 @@ jobs:
409408
run: |
410409
set -euox pipefail
411410
412-
sudo -E $(command -v just) push-image \
411+
$(command -v just) push-image \
413412
--image "${MATRIX_BASE_NAME}" \
414413
--tag "${MATRIX_STREAM_NAME}" \
415414
--flavor "${MATRIX_IMAGE_FLAVOR}" \

Justfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ disk-image $image="aurora" $tag="latest" $flavor="main" ghcr="false" $backend="o
840840
BOOTC_INSTALL_ARGS+=("--bootloader systemd" "--composefs-backend")
841841
fi
842842
843+
{{ just }} load-rootful --image "${image}" --tag "${tag}" --flavor "${flavor}"
844+
843845
{{ just }} bootc "${image}" "${tag}" "${flavor}" install to-disk "${BOOTC_INSTALL_ARGS[@]}"
844846
845847
# FIXME: Please consider using podman push in the future for signing as well instead of temporary tag + cosign

0 commit comments

Comments
 (0)