generated from ublue-os/base
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from ublue-os/containerfile-refactor
forcing this merge since the actions are broken and it's day 0 so yolo.
- Loading branch information
Showing
13 changed files
with
104 additions
and
282 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,31 +1,17 @@ | ||
# Multi-stage build | ||
ARG FEDORA_MAJOR_VERSION=37 | ||
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" | ||
ARG BASE_IMAGE="quay.io/fedora-ostree-desktops/${IMAGE_NAME}" | ||
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}" | ||
|
||
## Build ublue-os-base | ||
FROM quay.io/fedora-ostree-desktops/silverblue:${FEDORA_MAJOR_VERSION} | ||
# See https://pagure.io/releng/issue/11047 for final location | ||
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder | ||
|
||
COPY etc /etc | ||
COPY usr /usr | ||
ARG IMAGE_NAME="${IMAGE_NAME}" | ||
|
||
COPY ublue-firstboot /usr/bin | ||
COPY recipe.yml /etc/ublue-recipe.yml | ||
ADD build.sh /tmp/build.sh | ||
ADD packages.json /tmp/packages.json | ||
|
||
COPY --from=docker.io/mikefarah/yq /usr/bin/yq /usr/bin/yq | ||
COPY --from=ghcr.io/ublue-os/udev-rules:latest /ublue-os-udev-rules.noarch.rpm /tmp/ublue-os-udev-rules.noarch.rpm | ||
|
||
RUN rpm-ostree override remove firefox firefox-langpacks && \ | ||
echo "-- Installing RPMs defined in recipe.yml --" && \ | ||
rpm_packages=$(yq '.rpms[]' < /etc/ublue-recipe.yml) && \ | ||
for pkg in $rpm_packages; do \ | ||
echo "Installing: ${pkg}" && \ | ||
rpm-ostree install $pkg; \ | ||
done && \ | ||
echo "---" && \ | ||
|
||
sed -i 's/#AutomaticUpdatePolicy.*/AutomaticUpdatePolicy=stage/' /etc/rpm-ostreed.conf && \ | ||
systemctl enable rpm-ostreed-automatic.timer && \ | ||
systemctl enable flatpak-system-update.timer && \ | ||
rm -rf \ | ||
/tmp/* \ | ||
/var/* && \ | ||
ostree container commit | ||
RUN /tmp/build.sh | ||
RUN rm -rf /tmp/* | ||
RUN ostree container commit | ||
RUN mkdir -p /var/tmp && chmod -R 1777 /var/tmp |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
set -ouex pipefail | ||
|
||
RELEASE="$(rpm -E %fedora)" | ||
|
||
INCLUDED_PACKAGES=($(jq -r "[.include | (.all, select(.$IMAGE_NAME != null).$IMAGE_NAME)[]] | unique | sort[]" /tmp/packages.json)) | ||
EXCLUDED_PACKAGES=($(jq -r "[.exclude | (.all, select(.$IMAGE_NAME != null).$IMAGE_NAME)[]] | unique | sort[]" /tmp/packages.json)) | ||
|
||
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]})) | ||
fi | ||
|
||
rpm-ostree install \ | ||
https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${RELEASE}.noarch.rpm \ | ||
https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${RELEASE}.noarch.rpm \ | ||
/tmp/ublue-os-udev-rules.noarch.rpm \ | ||
fedora-repos-archive | ||
|
||
if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -eq 0 ]]; then | ||
rpm-ostree install \ | ||
${INCLUDED_PACKAGES[@]} | ||
|
||
elif [[ "${#INCLUDED_PACKAGES[@]}" -eq 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
rpm-ostree override remove \ | ||
${EXCLUDED_PACKAGES[@]} | ||
|
||
elif [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
rpm-ostree override remove \ | ||
${EXCLUDED_PACKAGES[@]} \ | ||
$(printf -- "--install=%s " ${INCLUDED_PACKAGES[@]}) | ||
|
||
else | ||
echo "No packages to install." | ||
|
||
fi |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"include": { | ||
"all": [] | ||
}, | ||
"exclude": { | ||
"all": [] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.