forked from K4rian/docker-yuzu-room
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
96 lines (87 loc) · 3.25 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
86
87
88
89
90
91
92
93
94
95
96
# Build the server binary
FROM alpine:latest as builder
RUN apk update \
&& apk -U add --no-cache \
autoconf \
bash \
build-base \
binutils-gold \
ca-certificates \
cmake \
git \
glslang \
jq \
libarchive-tools \
libstdc++ \
linux-headers \
ninja-build \
openssl-dev \
wget \
xz \
yasm \
&& export PATH=$PATH:/bin:/usr/local/bin:/usr/bin:/sbin:/usr/lib/ninja-build/bin \
&& mkdir -p /server/lib /tmp/yuzu/build /tmp/yuzu/room /tmp/yuzu/mainline \
&& cd /tmp/yuzu \
&& wget -c "https://github.com/K4rian/docker-yuzu-room/releases/download/v0.1734/multiplayer-dedicated.tar.gz" -O multiplayer-dedicated.tar.xz \
&& wget -c "https://github.com/K4rian/docker-yuzu-room/releases/download/v0.1734/mainline-1734.tar.gz" -O mainline.tar.xz \
&& tar --strip-components=1 -xf multiplayer-dedicated.tar.xz -C /tmp/yuzu/room \
&& tar --strip-components=1 -xf mainline.tar.xz -C /tmp/yuzu/mainline \
&& cd /tmp/yuzu/mainline \
&& git apply /tmp/yuzu/room/patches/*.patch \
&& cd /tmp/yuzu/room/.ci \
&& bash deps.sh \
&& cd /tmp/yuzu/build \
&& { echo "#!/bin/ash"; \
echo "CFLAGS=\"-ftree-vectorize -flto\""; \
echo "if [[ \"$(uname -m)\" == \"aarch64\" ]]; then"; \
echo " CFLAGS=\"$CFLAGS -march=armv8-a+crc+crypto\""; \
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=\"-flto -fuse-linker-plugin -fuse-ld=gold\""; \
echo "cmake ../mainline -GNinja -DCMAKE_BUILD_TYPE=Release \\"; \
echo " -DENABLE_SDL2=OFF -DENABLE_QT=OFF -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=OFF \\"; \
echo " -DUSE_DISCORD_PRESENCE=OFF -DYUZU_USE_BUNDLED_FFMPEG=ON -DYUZU_TESTS=OFF \\"; \
echo " -DENABLE_LIBUSB=OFF"; \
echo "ninja yuzu-room"; \
} >/tmp/yuzu/build/build.sh \
&& chmod +x /tmp/yuzu/build/build.sh \
&& /tmp/yuzu/build/build.sh \
&& cp /tmp/yuzu/build/bin/yuzu-room /server/yuzu-room \
&& strip /server/yuzu-room \
&& chmod +x /server/yuzu-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 "YuzuRoom-BanList-1" > /server/bannedlist.ybl \
&& touch /server/yuzu-room.log \
&& rm -R /tmp/yuzu
# Set-up the server
FROM alpine:latest
ENV USERNAME yuzu
ENV USERHOME /home/$USERNAME
# Required
ENV YUZU_BINDADDR "0.0.0.0"
ENV YUZU_PORT 24872
ENV YUZU_ROOMNAME "yuzu Room"
ENV YUZU_PREFGAME "Any"
ENV YUZU_MAXMEMBERS 4
ENV YUZU_BANLISTFILE "bannedlist.ybl"
ENV YUZU_LOGFILE "yuzu-room.log"
# Optional
ENV YUZU_ROOMDESC ""
ENV YUZU_PREFGAMEID "0"
ENV YUZU_PASSWORD ""
ENV YUZU_ISPUBLIC 0
ENV YUZU_TOKEN ""
ENV YUZU_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"]