Repository navigation
Expand file tree
/
Copy pathDockerfile.fedora
More file actions
70 lines (63 loc) · 2.41 KB
/
Copy pathDockerfile.fedora
File metadata and controls
70 lines (63 loc) · 2.41 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
67
68
69
70
# Stage 1: build the arch-specific artifacts that must not ship with their build deps.
# Built on Fedora itself so libdisableselinux.so links against the same glibc it
# is preloaded into.
FROM fedora:latest AS builder
RUN dnf install -y --setopt=install_weak_deps=False gcc busybox \
&& dnf clean all
COPY input/disableselinux.c /tmp/disableselinux.c
RUN mkdir /build \
&& gcc -shared -fPIC /tmp/disableselinux.c -o /build/libdisableselinux.so \
&& cp /usr/sbin/busybox /build/busybox
# Stage 2: the real rootfs — no build toolchain
FROM fedora:latest
RUN printf '#!/bin/sh\nunset LD_PRELOAD\nunset LD_LIBRARY_PATH\nexport LIBGL_ALWAYS_SOFTWARE=1\n' \
> /etc/profile.d/userland.sh && chmod +x /etc/profile.d/userland.sh
# systemd is a hard requirement of the AVF backend, not a convenience: avf-init
# pivot_roots into /lib/systemd/systemd and runs it as PID 1 when present, which
# is what makes `systemctl` -- and therefore Docker, podman and any packaged
# .service unit -- work inside the VM. The fedora container image leaves it out,
# and dbus-broker with it: without a system bus, dbus.socket and logind fail,
# the system comes up "degraded", and systemctl run as the user cannot connect.
#
# Fedora has no tightvncserver; tigervnc-x11-server provides Xvnc and
# tigervnc-server-common vncpasswd, which assets/fedora/startVNCServerStep2.sh
# drives directly. twm is no longer packaged, so openbox stands in as the
# minimal image's window manager.
RUN dnf install -y --setopt=install_weak_deps=False \
systemd \
dbus-broker \
sudo \
passwd \
util-linux \
procps-ng \
hostname \
iproute \
which \
less \
nano \
dropbear \
fuse-sshfs \
tigervnc-x11-server \
tigervnc-server-common \
xterm \
openbox \
xsetroot \
xprop \
xorg-x11-fonts-misc \
dejavu-sans-mono-fonts \
mesa-dri-drivers \
mesa-libGL \
wget \
pulseaudio-utils \
&& dnf clean all
COPY --from=builder /build/busybox /support/busybox
COPY --from=builder /build/libdisableselinux.so /support/libdisableselinux.so
COPY assets/common/ /support/
COPY assets/fedora/ /support/
RUN chmod a+x /support/busybox \
/support/libdisableselinux.so \
/support/nosudo \
/support/userland-session \
/support/*.sh \
&& chmod a-w /support/* \
&& chmod a-w /support