-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbase.Dockerfile
75 lines (66 loc) · 2.89 KB
/
base.Dockerfile
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
72
73
74
75
##
# Base dockerfile for RPCEmu.
#
# Creates a user 'riscos' which contains the RPCEmu and VNC configuration.
#
# Directories in image:
# /rpcemu - Installation of RPCEmu, with:
# `hostfs` linked to `/riscos`
# `roms` linked to `/riscos-roms`
# /riscos - The RPCEmu `hostfs` directory
# /riscos-roms - a directory containing ROMs
FROM ubuntu:24.04
ARG RPCEMU_VERSION=0.9.3
# Add user we're going to run under (without a password)
RUN useradd riscos && \
mkdir -p /home/riscos && \
chown -R riscos:riscos /home/riscos
# Install the VNC server, with the build system and libraries.
# The password for the VNC server is 'password'.
USER root
RUN apt-get update && \
DEBIAN_FRONTEND="noninteractive" apt-get install -y tigervnc-standalone-server fluxbox locales \
build-essential \
qtbase5-dev \
qtmultimedia5-dev \
libqt5multimedia5-plugins \
python3-pip \
wget unzip rsync \
&& \
locale-gen en_US.UTF-8 && \
mkdir -p /home/riscos/.vnc && \
echo "29g8/XJ6FFg=" | base64 -d > /home/riscos/.vnc/passwd && \
chown -R riscos:riscos /home/riscos/.vnc && \
chmod 0600 /home/riscos/.vnc/passwd && \
pip3 install --break-system-packages gdown && \
rm -rf ~/.cache/pip /var/lib/apt/lists && \
mkdir -p /rpcemu /riscos /riscos-roms && \
chown riscos:riscos /rpcemu /riscos /riscos-roms && \
ln -s /rpcemu /home/riscos/rpcemu
# Build RPCEmu
WORKDIR /home/riscos
USER riscos
RUN cd /tmp && \
wget -O rpcemu-${RPCEMU_VERSION}.tar.gz "https://www.marutan.net/rpcemu/cgi/download.php?sFName=${RPCEMU_VERSION}/rpcemu-${RPCEMU_VERSION}.tar.gz" && \
tar zxf rpcemu-${RPCEMU_VERSION}.tar.gz && \
cd rpcemu-${RPCEMU_VERSION}/src/qt5 && \
sed -i 's/CONFIG += debug_and_release/CONFIG += debug_and_release dynarec/' rpcemu.pro && \
./buildit.sh && \
make && \
cd ../.. && \
rm -rf src && \
cd .. && \
mv rpcemu-${RPCEMU_VERSION}/* /rpcemu/ && \
mv /rpcemu/hostfs/* /riscos/ && rmdir /rpcemu/hostfs && \
mv /rpcemu/roms/* /riscos-roms/ && rmdir /rpcemu/roms && \
ln -s /riscos /rpcemu/hostfs && \
ln -s /riscos-roms /rpcemu/roms && \
rm -rf /tmp/rpcemu-${RPCEMU_VERSION}.tar.gz /tmp/rpcemu-${RPCEMU_VERSION}
RUN sed -i s/sound_enabled=1/sound_enabled=0/ rpcemu/rpc.cfg
# Configure the fluxbox environment to hide most parts of it.
ADD --chown=riscos:riscos fluxbox-init /home/riscos/.fluxbox/init
ADD --chown=riscos:riscos fluxbox-menu /home/riscos/.fluxbox/menu
ADD --chown=riscos:riscos fluxbox-windowmenu /home/riscos/.fluxbox/windowmenu
ENV PATH="$PATH:/rpcemu"
CMD ["bash", "-c", "export DISPLAY=:1 USER=riscos && vncserver -geometry 1280x1024 -localhost no >/dev/null 2>/dev/null && cd rpcemu && ./rpcemu-recompiler"]
EXPOSE 5901