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