.gitea/workflows/redhat_build.yml aktualisiert
This commit is contained in:
@@ -86,20 +86,28 @@ jobs:
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install -y buildah fuse-overlayfs
|
||||
|
||||
# 5. Image mit Buildah bauen
|
||||
# 5. Image direkt mit Buildah bauen (erzwingt --isolation chroot)
|
||||
- name: Build Image with Buildah
|
||||
id: build_image
|
||||
uses: redhat-actions/buildah-build@v3.0.2
|
||||
env:
|
||||
BUILDAH_ISOLATION: chroot
|
||||
_BUILDAH_STARTED_IN_USERNS: ""
|
||||
with:
|
||||
image: ${{ env.IMAGE_NAME }}
|
||||
tags: ${{ env.IMAGE_TAG }}
|
||||
containerfiles: ./Containerfile
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
||||
oci: true
|
||||
isolation: chroot
|
||||
run: |
|
||||
# Systemweite Containers-Konfig auf chroot festlegen
|
||||
sudo mkdir -p /etc/containers
|
||||
printf '[containers]\nisolation = "chroot"\n' | sudo tee /etc/containers/containers.conf
|
||||
|
||||
# Metadata-Labels sauber in --label Argumente umwandeln
|
||||
LABEL_FLAGS=""
|
||||
while IFS= read -r line; do
|
||||
if [ -n "$line" ]; then
|
||||
LABEL_FLAGS="${LABEL_FLAGS} --label ${line}"
|
||||
fi
|
||||
done <<< "${{ steps.metadata.outputs.labels }}"
|
||||
|
||||
# Bildah mit explizitem --isolation chroot ausführen
|
||||
buildah bud \
|
||||
--isolation chroot \
|
||||
--format oci \
|
||||
${LABEL_FLAGS} \
|
||||
-t "${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}" \
|
||||
-f ./Containerfile .
|
||||
|
||||
# 6. In lokales OCI-Verzeichnis exportieren
|
||||
- name: Export Image to OCI Layout
|
||||
|
||||
Reference in New Issue
Block a user