-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
101 lines (77 loc) · 2.18 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
97
98
99
100
101
ARG BASE=docker.io/ubuntu:22.04
ARG CONFIGURE_ARGS=""
ARG FAKERELEASE=false
ARG PROGNAME="armagetronad"
ARG PROGTITLE="Armagetron Advanced"
########################################
# runtime prerequisites
FROM ${BASE} AS runtime_base
LABEL maintainer="Manuel Moos <z-man@users.sf.net>"
ARG PROGNAME
RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
bash \
libboost-thread1.74.0 \
libxml2 \
libprotobuf23 \
runit \
-y
# use libprotobuf32 from ubuntu 23.04 onward
WORKDIR /
########################################
# development prerequisites
FROM runtime_base AS builder
# build dependencies
RUN apt-get -y update && DEBIAN_FRONTEND=noninteractive apt-get install \
autoconf \
automake \
libboost-all-dev \
patch \
bash \
bison \
bzip2 \
g++ \
make \
libtool \
libxml2-dev \
protobuf-compiler \
pkg-config \
python3 \
wget \
-y
########################################
# build
FROM builder as build
ARG CONFIGURE_ARGS
ARG FAKERELEASE
ARG PROGNAME
ARG PROGTITLE
ENV SOURCE_DIR /root/${PROGNAME}
ENV BUILD_DIR /root/build
COPY . ${SOURCE_DIR}
WORKDIR ${SOURCE_DIR}
RUN (test -r configure && test -f missing) || (./bootstrap.sh && cat version.m4)
RUN mkdir -p ${BUILD_DIR} && chmod 755 ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN ARMAGETRONAD_FAKERELEASE=${FAKERELEASE} progname="${PROGNAME}" progtitle="${PROGTITLE}" \
${SOURCE_DIR}/configure --prefix=/usr/local --disable-glout --disable-sysinstall --disable-useradd \
--disable-master --disable-uninstall --disable-desktop \
${CONFIGURE_ARGS} && \
make -j `nproc` && \
DESTDIR=/root/destdir make install && \
rm -rf ${SOURCE_DIR} ${BUILD_DIR}
########################################
# finish runtime
FROM runtime_base AS runtime
# pack
FROM runtime AS run_server
ARG PROGNAME
COPY --chown=root --from=build /root/destdir /
COPY batch/docker-entrypoint.sh.in /usr/local/bin/docker-entrypoint.sh
RUN bash /usr/local/share/games/*-dedicated/scripts/sysinstall install /usr/local && \
sed -i /usr/local/bin/docker-entrypoint.sh -e "s/@progname@/${PROGNAME}/g" && \
chmod 755 /usr/local/bin/docker-entrypoint.sh
USER nobody
VOLUME ["/var/${PROGNAME}"]
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
#ENTRYPOINT ["bash"]
EXPOSE 4534/udp