summaryrefslogtreecommitdiff
path: root/base/Containerfile
blob: a4ff2f440b64e838d824c50a5652a89f9a7030ce (plain)
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
67
68
69
70
71
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-silverblue}"
ARG BASE_IMAGE="quay.io/fedora-ostree-desktops/${IMAGE_FLAVOR}"
ARG FEDORA_VERSION="${FEDORA_VERSION:-39}"

FROM ${BASE_IMAGE}:${FEDORA_VERSION}
ARG FEDORA_VERSION="${FEDORA_VERSION:-39}"


COPY initial_setup.sh /usr/bin/
COPY packages.yaml /tmp/
COPY --from=docker.io/mikefarah/yq /usr/bin/yq /tmp/

# remove non-flatpak firefox
RUN rpm-ostree override remove firefox firefox-langpacks

# setup third party repos
RUN rpm-ostree install \
	https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${FEDORA_VERSION}.noarch.rpm \
	https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${FEDORA_VERSION}.noarch.rpm

# install software/hardware codecs
RUN rpm-ostree override remove \
	mesa-va-drivers \
	libavcodec-free \
	libavfilter-free \
	libavformat-free \
	libavutil-free \
	libpostproc-free \
	libswresample-free \
	libswscale-free && \
	rpm-ostree install \
	mesa-va-drivers-freeworld \
	mesa-vdpau-drivers-freeworld \
	gstreamer1-plugin-libav \
	gstreamer1-plugins-bad-free-extras \
	gstreamer1-plugins-bad-freeworld \
	gstreamer1-plugins-ugly \
	gstreamer1-vaapi \
	ffmpeg


# install third party packages & repos
RUN cd /etc/yum.repos.d/ && \
	curl -LO https://pkgs.tailscale.com/stable/fedora/tailscale.repo \
	echo -e '\
	[code]\n\
	name=Visual Studio Code\n\
	baseurl=https://packages.microsoft.com/yumrepos/vscode\n\
	enabled=1\n\
	gpgcheck=1\n\
	gpgkey=https://packages.microsoft.com/keys/microsoft.asc\
	' > vscode.repo && \
	rpm-ostree install code tailscale && \
	systemctl enable tailscaled


# install fedora rpms
RUN readarray -td '' pkgs < <(/tmp/yq '.install[]' /tmp/packages.yaml) && \
	rpm-ostree install "${pkgs[@]}"

# enable automatic updates
RUN sed -i 's/#AutomaticUpdatePolicy.*/AutomaticUpdatePolicy=stage/' /etc/rpm-ostreed.conf

# bring in config layer
COPY --from=ghcr.io/getchoo/config:${FEDORA_VERSION} /rpms /tmp/config
RUN rpm-ostree install /tmp/config/container-policy/getchoo-container-policy*.rpm


RUN rpm-ostree cleanup -m && \
	rm -rf /tmp/* /var/* && \
	ostree container commit