-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
85 lines (75 loc) · 2.88 KB
/
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
76
77
78
79
80
81
82
83
84
85
FROM alpine:3.20 AS builder
WORKDIR /tmp/citra
RUN apk update \
&& apk -U add --no-cache \
build-base \
binutils-gold \
ca-certificates \
cmake \
glslang \
libstdc++ \
linux-headers \
ninja-build \
openssl-dev \
wget \
xz \
&& export PATH=$PATH:/bin:/usr/local/bin:/usr/bin:/sbin:/usr/lib/ninja-build/bin \
&& mkdir -p /server/lib /tmp/citra/build \
&& wget --show-progress -q -c -O "citra-unified.tar.xz" "https://github.com/K4rian/docker-citra-room/releases/download/v0.2798/canary-unified-source-20240304-d996981.tar.xz" \
&& tar --strip-components=1 -xf citra-unified.tar.xz \
&& { echo "#!/bin/ash"; \
echo "SCRIPT_DIR=\$(dirname \"\$(readlink -f \"\$0\")\")"; \
echo "cd \$SCRIPT_DIR"; \
echo "LDFLAGS=\"-flto -fuse-linker-plugin -fuse-ld=gold\""; \
echo "CFLAGS=\"-ftree-vectorize -flto\""; \
echo "if [[ \"$(uname -m)\" == \"aarch64\" ]]; then"; \
echo " CFLAGS=\"-O2\""; \
echo " LDFLAGS=\"\""; \
echo "elif [[ \"$(uname -m)\" == \"x86_64\" ]]; then"; \
echo " CFLAGS=\"$CFLAGS -march=core2 -mtune=intel\""; \
echo "fi"; \
echo "export CFLAGS"; \
echo "export CXXFLAGS=\"$CFLAGS\""; \
echo "export LDFLAGS"; \
echo "cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release \\"; \
echo " -DENABLE_SDL2=OFF -DENABLE_QT=OFF -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \\"; \
echo " -DUSE_DISCORD_PRESENCE=OFF -DENABLE_FFMPEG_VIDEO_DUMPER=OFF -DUSE_SYSTEM_OPENSSL=ON \\"; \
echo " -DCITRA_WARNINGS_AS_ERRORS=OFF -DENABLE_LTO=ON"; \
echo "ninja citra-room "; \
} >/tmp/citra/build/build.sh \
&& chmod +x /tmp/citra/build/build.sh \
&& /tmp/citra/build/build.sh \
&& cp /tmp/citra/build/bin/Release/citra-room /server/citra-room \
&& strip /server/citra-room \
&& chmod +x /server/citra-room \
&& cp /usr/lib/libgcc_s.so.1 /server/lib/libgcc_s.so.1 \
&& cp /usr/lib/libstdc++.so.6 /server/lib/libstdc++.so.6 \
&& echo -e "CitraRoom-BanList-1" > /server/bannedlist.cbl \
&& touch /server/citra-room.log \
&& rm -R /tmp/citra
FROM alpine:3.20
ENV USERNAME=citra
ENV USERHOME=/home/$USERNAME
# Required
ENV CITRA_PORT=24872
ENV CITRA_ROOMNAME="Citra Room"
ENV CITRA_PREFGAME="Any"
ENV CITRA_MAXMEMBERS=4
ENV CITRA_BANLISTFILE="bannedlist.cbl"
ENV CITRA_LOGFILE="citra-room.log"
# Optional
ENV CITRA_ROOMDESC=""
ENV CITRA_PREFGAMEID="0"
ENV CITRA_PASSWORD=""
ENV CITRA_ISPUBLIC=0
ENV CITRA_TOKEN=""
ENV CITRA_WEBAPIURL=""
RUN apk update \
&& adduser --disabled-password $USERNAME \
&& rm -rf /tmp/* /var/tmp/*
COPY --from=builder --chown=$USERNAME /server/ $USERHOME/
COPY --chown=$USERNAME ./container_files/ $USERHOME/
USER $USERNAME
WORKDIR $USERHOME
RUN chmod +x docker-entrypoint.sh
ENTRYPOINT ["./docker-entrypoint.sh"]