forked from rmoriz/openra-dockerfile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
90 lines (79 loc) · 3.62 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
ARG BASE_IMAGE_PREFIX
FROM ${BASE_IMAGE_PREFIX}mono
# see hooks/post_checkout
ARG ARCH
# HACK: don't fail when no qemu binary provided
COPY .gitignore qemu-${ARCH}-static* /usr/bin/
ARG OPENRA_RELEASE_VERSION=20200202
ARG OPENRA_RELEASE
ARG OPENRA_RELEASE_TYPE=release
# https://www.openra.net/download/
ENV OPENRA_RELEASE_VERSION=${OPENRA_RELEASE_VERSION:-20200202}
ENV OPENRA_RELEASE_TYPE=${OPENRA_RELEASE_TYPE:-release}
ENV OPENRA_RELEASE=${OPENRA_RELEASE:-https://github.com/OpenRA/OpenRA/releases/download/${OPENRA_RELEASE_TYPE}-${OPENRA_RELEASE_VERSION}/OpenRA-${OPENRA_RELEASE_TYPE}-${OPENRA_RELEASE_VERSION}-source.tar.bz2}
RUN set -xe; \
echo "=================================================================="; \
echo "Building OpenRA:"; \
echo " version:\t${OPENRA_RELEASE_VERSION}"; \
echo " type: \t${OPENRA_RELEASE_TYPE}"; \
echo " source: \t${OPENRA_RELEASE}"; \
echo "=================================================================="; \
\
apt-get update; \
apt-get -y upgrade; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
liblua5.1 \
make \
patch \
unzip \
xdg-utils \
; \
useradd -d /home/openra -m -s /sbin/nologin openra; \
mkdir /home/openra/source; \
cd /home/openra/source; \
curl -L $OPENRA_RELEASE | tar xj; \
# HACK to fix hard coded paths in upstream in old releases.
# bleed status: https://github.com/OpenRA/OpenRA/blob/bleed/thirdparty/configure-native-deps.sh
mkdir -p /opt/lib; \
liblua=$(find /usr/lib -name liblua5.1.so); \
ln -s $liblua /opt/lib; \
ls -la /opt/lib/*.so; \
# /HACK
# PATCH 'SERVER FULL' BUG
if [ "$OPENRA_RELEASE_VERSION" = "20181215" ]; then \
curl -L https://github.com/OpenRA/OpenRA/commit/c6d5bc9511cf983b8b7a769ab3064ed45fc4fb02.diff | patch -p1; \
fi; \
# /PATCH
make dependencies; \
make all; \
make prefix= DESTDIR=/home/openra install; \
cd .. && rm -rf /home/openra/source; \
chmod 755 /home/openra/lib/openra/launch-dedicated.sh; \
mkdir /home/openra/.openra \
/home/openra/.openra/Logs \
/home/openra/.openra/maps \
;\
chown -R openra:openra /home/openra/.openra; \
apt-get purge -y curl make patch unzip; \
rm -rf /var/lib/apt/lists/* \
/var/cache/apt/archives/*
EXPOSE 1234
USER openra
WORKDIR /home/openra/lib/openra
VOLUME ["/home/openra/.openra"]
# https://github.com/OpenRA/OpenRA/blob/release-20200202/launch-dedicated.sh
# NOTE: With 2020202 geoip mapping and player IPs are not resolved/disclosed
# anymore due to upstream and privacy reasons.
# see options "Server.ShareAnonymizedIPs" and "Server.GeoIPDatabase"
CMD [ "/home/openra/lib/openra/launch-dedicated.sh" ]
# annotation labels according to
# https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md#pre-defined-annotation-keys
LABEL org.opencontainers.image.title="OpenRA dedicated server"
LABEL org.opencontainers.image.description="Image to run a server instance for OpenRA"
LABEL org.opencontainers.image.url="https://github.com/rmoriz/openra-dockerfile"
LABEL org.opencontainers.image.documentation="https://github.com/rmoriz/openra-dockerfile#readme"
LABEL org.opencontainers.image.version=${OPENRA_RELEASE_TYPE}-${OPENRA_RELEASE_VERSION}
LABEL org.opencontainers.image.licenses="GPL-3.0"
LABEL org.opencontainers.image.authors="Roland Moriz"