-
Notifications
You must be signed in to change notification settings - Fork 5
/
Containerfile
49 lines (44 loc) · 1.94 KB
/
Containerfile
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
# **Description:**
# > IMPORTANT NOTE: This is BOOTC. This is meant for bootable container applications. See: https://github.com/containers/podman-desktop-extension-bootc
#
# This Containerfile is meant for testing GUI loading with the bootc extension using fedora:40.
# there are no users created in this image, so you will need to create a user to login from within the Containerfile using the "ARG" directive and a public SSH key.
# This is also very unstable..
#
# **Running:**
# 1. Create disk image using the above extension
# 2. Boot OS
# 3. See that it is a GUI that was loaded (cinnamon desktop)
# 4. Login with the user and password you passed in.
FROM quay.io/fedora/fedora-bootc:40
#! Use a patched version of rootfiles
#! Checkout the specific pull request (PR#5 in this case)
RUN dnf install -y rpm-build git dnf-plugins-core
WORKDIR /usr/src/rootfiles
RUN git clone https://src.fedoraproject.org/rpms/rootfiles.git .
RUN git fetch origin +refs/pull/*:refs/remotes/origin/pr/*
RUN git checkout origin/pr/5/head
RUN dnf builddep -y rootfiles.spec
RUN rpmbuild -bb rootfiles.spec \
--define "_topdir `pwd`" \
--define "_sourcedir `pwd`" \
--define "_specdir `pwd`" \
--define "_builddir `pwd`" \
--define "_srcrpmdir `pwd`" \
--define "_rpmdir `pwd`"
RUN dnf install -y ./noarch/rootfiles-*.rpm
RUN dnf clean all
#! Create a user / add the SSH key
COPY wheel-nopasswd /etc/sudoers.d
ARG username=exampleuser
ARG sshpubkey
ARG userpassword
RUN if test -z "$sshpubkey" || test -z "$userpassword"; then echo "SSH key and password must be provided"; exit 1; fi; \
useradd -G wheel $username && \
echo "${username}:${userpassword}" | chpasswd && \
mkdir -m 0700 -p /home/$username/.ssh && \
echo $sshpubkey > /home/$username/.ssh/authorized_keys && \
chmod 0600 /home/$username/.ssh/authorized_keys && \
chown -R $username: /home/$username
#! Install the GUI
RUN dnf groupinstall "Cinnamon Desktop" --exclude=rootfiles -y