Use shell-exec to run buildah

This commit is contained in:
Jeffrey Serio 2024-03-06 20:20:54 -06:00
parent d578422ace
commit 5e1406f82a
2 changed files with 6 additions and 26 deletions

View File

@ -4,14 +4,12 @@ stages:
fedora-build-job:
stage: build
tags:
- podman-exec
image: git.hyperreal.coffee:5050/fedora-atomic/containers/buildah:latest
- shell-exec
variables:
STORAGE_DRIVER: vfs
BUILDAH_FORMAT: docker
BUILDAH_ISOLATION: chroot
FQ_IMAGE_NAME: "$CI_REGISTRY_IMAGE/fedora:latest"
before_script:
- buildah rm --all
- buildah prune -af
- buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- container=$(buildah from registry.fedoraproject.org/fedora:latest)
@ -25,14 +23,13 @@ fedora-build-job:
fedora-distrobox-build-job:
stage: build
tags:
- podman-exec
image: git.hyperreal.coffee:5050/fedora-atomic/containers/buildah:latest
- shell-exec
variables:
STORAGE_DRIVER: vfs
BUILDAH_FORMAT: docker
BUILDAH_ISOLATION: chroot
FQ_IMAGE_NAME: "$CI_REGISTRY_IMAGE/fedora-distrobox:39"
before_script:
- buildah rm --all
- buildah prune -af
- buildah login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- container=$(buildah from registry.fedoraproject.org/fedora-toolbox:39)

View File

@ -1,17 +0,0 @@
FROM quay.io/buildah/stable:v1.34.0
RUN touch /etc/subgid /etc/subuid \
&& chmod g=u /etc/subgid /etc/subuid /etc/passwd \
&& echo build:10000:65536 > /etc/subuid \
&& echo build:10000:65536 > /etc/subgid
# Use chroot since the default runc doesn't work when running rootless
RUN echo "export BUILDAH_ISOLATION=chroot" >> /home/build/.bashrc
# Use VFS since fuse does not work
RUN mkdir -p /home/build/.config/containers \
&& (echo '[storage]';echo 'drive = "vfs"') > /home/build/.config/containers/storage.conf
# The buildah container will run as build user
USER build
WORKDIR /home/build