Attempt to split build.sh again with more narrow cache
Some checks failed
Build container image / Build and push image (pull_request) Has been cancelled

This commit is contained in:
2025-10-20 22:36:58 -04:00
parent 61065e9944
commit 9ca1a074be
4 changed files with 82 additions and 39 deletions

View File

@@ -1,6 +1,6 @@
# Allow build scripts to be referenced without being copied into the final image # Allow build scripts to be referenced without being copied into the final image
FROM scratch AS ctx FROM scratch AS ctx
COPY build_files / COPY ./build_files /
# Base Image # Base Image
FROM quay.io/fedora-ostree-desktops/base-atomic:42 FROM quay.io/fedora-ostree-desktops/base-atomic:42
@@ -18,16 +18,76 @@ FROM quay.io/fedora-ostree-desktops/base-atomic:42
## make modifications desired in your image and install packages by modifying the build.sh script ## make modifications desired in your image and install packages by modifying the build.sh script
## the following RUN directive does all the things required to run "build.sh" as recommended. ## the following RUN directive does all the things required to run "build.sh" as recommended.
COPY system_files / COPY ./system_files /
# copy key into /etc/pki/containers/hydros.pub # copy key into /etc/pki/containers/hydros.pub
COPY cosign.pub /etc/pki/containers/hydros.pub COPY ./cosign.pub /etc/pki/containers/hydros.pub
## DNF
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \ RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache \ --mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=cache,dst=/var/log \
--mount=type=tmpfs,dst=/tmp \ --mount=type=tmpfs,dst=/tmp \
/ctx/build.sh /ctx/dnfstart.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=tmpfs,dst=/tmp \
/ctx/dnf/multimedia.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=tmpfs,dst=/tmp \
/ctx/dnf/greeter.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=tmpfs,dst=/tmp \
/ctx/dnf/hyprland.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=tmpfs,dst=/tmp \
/ctx/dnf/environment.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=tmpfs,dst=/tmp \
/ctx/dnf/applications.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=tmpfs,dst=/tmp \
/ctx/dnf/themes.sh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=cache,dst=/var/cache/libdnf5,id=dnf-cache-hydros,sharing=locked \
--mount=type=cache,dst=/var/cache/akmods,id=akmods-cache-hydros,sharing=locked \
--mount=type=tmpfs,dst=/tmp \
/ctx/dnf/drivers.sh
## Add Image Info
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
/ctx/addimageinfo.sh
## Install Oh My Zsh
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
/ctx/installohmyzsh.sh
# Install SystemD Services
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
/ctx/installservices.sh
## Cleanup
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
/ctx/cleanup.sh
### LINTING ### LINTING
## Verify final image and contents are correct. ## Verify final image and contents are correct.

View File

@@ -1,33 +0,0 @@
#!/bin/bash
set -ouex pipefail
### Install dnf packages
# Enable rpm fusion free and nonfree
dnf5 -y install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
/ctx/dnf/multimedia.sh
/ctx/dnf/greeter.sh
/ctx/dnf/hyprland.sh
/ctx/dnf/environment.sh
/ctx/dnf/applications.sh
/ctx/dnf/themes.sh
/ctx/dnf/drivers.sh
# finish by removing rpm fusion repo files
rm -f /etc/yum.repos.d/rpmfusion-*\.repo
### Add image info
/ctx/addimageinfo.sh
### Install Oh My Zsh
/ctx/installohmyzsh.sh
### Install SystemD services
/ctx/installservices.sh
### Cleanup
rm -rf /usr/etc
rm -rf /var/lib/dnf

10
build_files/cleanup.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -ouex pipefail
### Cleanup
rm -f /etc/yum.repos.d/rpmfusion-*\.repo
rm -rf /usr/etc
rm -rf /var/lib/dnf

6
build_files/dnfstart.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
set -ouex pipefail
# Enable rpm fusion free and nonfree
dnf5 -y install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm