-
Notifications
You must be signed in to change notification settings - Fork 3
/
BaseContainerfile
48 lines (43 loc) · 2.28 KB
/
BaseContainerfile
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
##
## This is the base image for the kiosk mode demo. It only contains
## content for the firefox browser to run in kiosk mode. There are
## placeholders for the flightgear flight simulator, but none of that
## software or content are installed.
##
FROM registry.redhat.io/rhel9/rhel-bootc:9.4
# configure an insecure local registry
RUN mkdir -p /etc/containers/registries.conf.d
COPY 999-local-registry.conf /etc/containers/registries.conf.d/
# install web browser, kiosk UI, and sound driver and then mask bootc
# auto-update timer so it doesn't interfere with the demo
RUN dnf install -y gnome-shell gnome-kiosk gnome-kiosk-script-session \
firefox unzip alsa-sof-firmware \
&& dnf -y clean all \
&& systemctl mask bootc-fetch-apply-updates.timer \
&& systemctl set-default graphical.target
# add kiosk mode content under /usr/share/kiosk-mode since /var/home
# cannot be updated after initial install. The fgdemo.conf file is a
# placeholder for use later with the flight simulator
ARG DEMO_USER
RUN useradd -m $DEMO_USER \
&& passwd -d $DEMO_USER \
&& mkdir -p /usr/share/kiosk-mode/bin \
/usr/share/kiosk-mode/downloads \
&& touch /usr/share/kiosk-mode/fgdemo.conf \
&& printf '#!/bin/sh\nsleep 5\nwpctl set-volume @DEFAULT_AUDIO_SINK@ 1.0\nfirefox -kiosk https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux/image-mode\nsleep 1.0\nexec "$0" "$@"' \
> /usr/share/kiosk-mode/bin/gnome-kiosk-script \
&& chmod +x /usr/share/kiosk-mode/bin/gnome-kiosk-script \
&& chown -R $DEMO_USER: /usr/share/kiosk-mode
# configure automatic logins and kiosk mode
ARG DEMO_USER
RUN sed -i.bak "/^\[daemon\]/aAutomaticLoginEnable=True\nAutomaticLogin=kiosk" /etc/gdm/custom.conf \
&& printf '[User]\nSession=gnome-kiosk-script\nSystemAccount=false' \
> /var/lib/AccountsService/users/$DEMO_USER
# soft-link kiosk user to kiosk-mode content
ARG DEMO_USER
RUN rm -fr /home/$DEMO_USER/Downloads \
&& ln -s /usr/share/kiosk-mode/downloads /home/$DEMO_USER/Downloads \
&& ln -s /usr/share/kiosk-mode/fgdemo.conf /home/$DEMO_USER/ \
&& mkdir -p /home/$DEMO_USER/.local/bin \
&& ln -s /usr/share/kiosk-mode/bin/gnome-kiosk-script /home/$DEMO_USER/.local/bin/ \
&& chown -R $DEMO_USER: /home/$DEMO_USER