generated from ublue-os/base
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve Containerfile / enable workflow usage of containerized …
…buildah (tag: v1) (#604)
- Loading branch information
Showing
6 changed files
with
94 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,44 @@ | ||
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" | ||
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-silverblue}" | ||
ARG SOURCE_ORG="${SOURCE_ORG:-fedora-ostree-desktops}" | ||
ARG IMAGE_NAME=silverblue | ||
ARG SOURCE_IMAGE=silverblue | ||
ARG SOURCE_ORG=fedora-ostree-desktops | ||
ARG BASE_IMAGE="quay.io/${SOURCE_ORG}/${SOURCE_IMAGE}" | ||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-40}" | ||
ARG KERNEL_VERSION="${KERNEL_VERSION:-6.9.7-200.fc40.x86_64}" | ||
ARG FEDORA_MAJOR_VERSION=40 | ||
ARG KERNEL_VERSION=6.9.7-200.fc40.x86_64 | ||
|
||
# workaround for selinux denying direct access to mounted buildcontext | ||
FROM scratch AS ctx | ||
COPY / / | ||
|
||
FROM ghcr.io/ublue-os/config:latest AS config | ||
FROM ghcr.io/ublue-os/akmods:main-${FEDORA_MAJOR_VERSION} AS akmods | ||
FROM ghcr.io/ublue-os/main-kernel:${KERNEL_VERSION} AS kernel | ||
|
||
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} | ||
|
||
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" | ||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-40}" | ||
ARG RPMFUSION_MIRROR="${:-}" | ||
ARG KERNEL_VERSION="${KERNEL_VERSION:-6.9.7-200.fc40.x86_64}" | ||
|
||
COPY github-release-install.sh \ | ||
install.sh \ | ||
post-install.sh \ | ||
packages.sh \ | ||
packages.json \ | ||
/tmp/ | ||
ARG IMAGE_NAME=silverblue | ||
ARG FEDORA_MAJOR_VERSION=40 | ||
ARG RPMFUSION_MIRROR= | ||
ARG KERNEL_VERSION=6.9.7-200.fc40.x86_64 | ||
|
||
COPY --from=config /rpms /tmp/rpms | ||
COPY --from=akmods /rpms/ublue-os /tmp/rpms | ||
COPY --from=kernel /tmp/rpms /tmp/kernel-rpms | ||
COPY sys_files/usr /usr | ||
|
||
RUN mkdir -p /var/lib/alternatives && \ | ||
/tmp/install.sh && \ | ||
/tmp/post-install.sh && \ | ||
mv /var/lib/alternatives /staged-alternatives && \ | ||
rm -rf /tmp/* /var/* && \ | ||
ostree container commit && \ | ||
mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives && \ | ||
mkdir -p /tmp /var/tmp && \ | ||
chmod -R 1777 /tmp /var/tmp | ||
RUN --mount=type=bind,from=ctx,source=/,target=/buildcontext \ | ||
--mount=type=bind,from=config,source=/rpms,target=/rpms/config \ | ||
--mount=type=bind,from=akmods,source=/rpms,target=/rpms/akmods \ | ||
--mount=type=bind,from=kernel,source=/tmp/rpms,target=/rpms/kernel \ | ||
<<EOF | ||
set -eux | ||
|
||
export RPMS_DIR="/rpms" | ||
export BUILDCONTEXT_DIR="/buildcontext" | ||
|
||
mkdir -p /var/lib/alternatives | ||
/buildcontext/install.sh | ||
/buildcontext/post-install.sh | ||
mv /var/lib/alternatives /staged-alternatives | ||
rm -rf /tmp/* /var/* | ||
ostree container commit | ||
mkdir -p /var/lib | ||
mv /staged-alternatives /var/lib/alternatives | ||
mkdir -p /tmp /var/tmp | ||
chmod -R 1777 /tmp /var/tmp | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/usr/bin/bash | ||
|
||
set -ouex pipefail | ||
|
||
|