-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile.fedora-kinoite-laptop-update-snapshot
38 lines (36 loc) · 1.64 KB
/
Containerfile.fedora-kinoite-laptop-update-snapshot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM ghcr.io/prydom/fedora-kinoite-laptop:snapshot
LABEL org.opencontainers.image.title="fedora-kinoite-laptop"
LABEL org.opencontainers.image.description="Upgrade snapshot of fedora-kinoite-laptop rebuilt at least weekly"
# Module RUNs
RUN \
--mount=type=tmpfs,target=/var \
--mount=type=bind,from=ghcr.io/prydom/fedora-kinoite-laptop-rpms,src=/,dst=/tmp/rpms \
--mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-fedora-kinoite-laptop-snapshot,sharing=locked \
echo "========== Start Upgrade ==========" \
# Swap opt symlink
&& rm /opt \
&& ln -s usr/lib/opt /opt \
# copy in my RPMs
&& rm -rf /usr/share/local-rpm-repo/* \
&& cp -r /tmp/rpms/* /usr/share/local-rpm-repo \
&& createrepo /usr/share/local-rpm-repo \
# Upgrade image - fail the pipeline if there no upgrades
&& python3 -u /usr/sbin/ostree-dnf-upgrade.py --fail-if-no-upgrades \
# clear accounts so they uid/gids get assigned by sysusers.d
&& echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd \
&& echo "root:x:0:" > /etc/group \
&& echo "wheel:x:10:" >> /etc/group \
# Put back /opt
&& rm /opt \
&& ln -s var/opt /opt \
# merge /usr/etc into /etc otherwise ostree tar import is not consistent
&& mkdir -p /usr/etc \
&& cp -fal /usr/etc / \
# Virtualization packages install files in /boot we don't want
&& rm -rf /boot \
&& mkdir -m 755 /boot \
# rpm-ostree creates /40-rpmostree-pkg-usermod-qemu-kvm.conf for some reason
# a similar file exists in /usr/lib/sysusers.d so just delete it
&& rm -f /*.conf \
&& echo "========== End Upgrade ==========" \
&& ostree container commit