forked from bopp-os/cachyos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile.cosmic
More file actions
66 lines (58 loc) · 3.42 KB
/
Copy pathContainerfile.cosmic
File metadata and controls
66 lines (58 loc) · 3.42 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# GuaraOS Containerfile.cosmic
#
# Desktop overlay containing COSMIC Desktop (compositor, greeter, shell, and first-party apps).
ARG BASE_IMAGE_TAG=latest
FROM ghcr.io/guara92/guaraos-base:${BASE_IMAGE_TAG}
ARG BASE_IMAGE_TAG
ARG TARGET_CPU_MARCH=v3
# ==========================================
# MASTER PACKAGE INSTALLATION
# ==========================================
# --- Desktop Environment (COSMIC) Core ---
RUN --mount=type=cache,id=guaraos-cache-${BASE_IMAGE_TAG},target=/usr/lib/sysimage/cache/pacman/pkg \
COMPONENT_TAG="cosmic-core" pacman -Sy --noconfirm --needed \
cosmic-session cosmic-comp cosmic-bg cosmic-greeter cosmic-panel cosmic-launcher \
cosmic-applets cosmic-app-library cosmic-notifications cosmic-osd \
cosmic-settings cosmic-settings-daemon cosmic-workspaces \
xdg-desktop-portal-cosmic && \
if [ -e /usr/etc ]; then if [ ! -L /usr/etc ] && [ -n "$(ls -A /usr/etc 2>/dev/null)" ]; then cp -a /usr/etc/* /etc/ 2>/dev/null || true; fi && rm -rf /usr/etc; fi
# --- COSMIC First-Party Applications + Extras ---
RUN --mount=type=cache,id=guaraos-cache-${BASE_IMAGE_TAG},target=/usr/lib/sysimage/cache/pacman/pkg \
COMPONENT_TAG="cosmic-apps" pacman -Sy --noconfirm --needed \
cosmic-files cosmic-terminal cosmic-text-editor cosmic-screenshot cosmic-player \
cosmic-randr cosmic-store cosmic-initial-setup cosmic-wallpapers cosmic-icon-theme && \
if [ -e /usr/etc ]; then if [ ! -L /usr/etc ] && [ -n "$(ls -A /usr/etc 2>/dev/null)" ]; then cp -a /usr/etc/* /etc/ 2>/dev/null || true; fi && rm -rf /usr/etc; fi
# No COSMIC-specific overlay files yet — uncomment when files/cosmic/ is populated:
# COPY files/cosmic/etc /etc/
# COPY files/cosmic/usr /usr/
# Enable DE services
# We disable SDDM, GDM, and plasmalogin if they were enabled, and enable cosmic-greeter
RUN systemctl disable sddm.service || true && \
systemctl disable gdm.service || true && \
systemctl disable plasmalogin.service || true && \
systemctl enable cosmic-greeter.service
# ==========================================
# Final system-wide upgrade (always runs — invalidated by CACHEBUST on every build)
# Updates ALL installed packages from official repos AND AUR via paru.
# ARG CACHEBUST is placed here (not at the top) so only this step and the ones
# below are invalidated — all DE install steps above remain cached.
# ==========================================
ARG CACHEBUST
RUN --mount=type=tmpfs,dst=/run \
--mount=type=cache,id=guaraos-cache-${TARGET_CPU_MARCH},target=/usr/lib/sysimage/cache/pacman/pkg \
useradd -m -u 65499 guaraos-updater && \
echo "guaraos-updater ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/guaraos-updater && \
sudo -u guaraos-updater \
HOME=/home/guaraos-updater \
XDG_CACHE_HOME=/home/guaraos-updater/.cache \
paru --noconfirm --needed --removemake --skipreview -Syu && \
userdel -r guaraos-updater && \
sed -i '/^guaraos-updater:/d' /etc/subuid /etc/subgid 2>/dev/null || true && \
rm -f /etc/sudoers.d/guaraos-updater && \
if [ -e /usr/etc ]; then if [ ! -L /usr/etc ] && [ -n "$(ls -A /usr/etc 2>/dev/null)" ]; then cp -a /usr/etc/* /etc/ 2>/dev/null || true; fi && rm -rf /usr/etc; fi
# Preserve /opt contents for OverlayFS
# (visual-studio-code-bin and others install here)
RUN mkdir -p /usr/lib/opt && \
if [ -d /opt ] && [ "$(ls -A /opt)" ]; then \
find /opt -mindepth 1 -maxdepth 1 -exec mv -t /usr/lib/opt/ {} + || true; \
fi