forked from andrewjkrull/dedicated-megamek-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (38 loc) · 1.47 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
FROM ubuntu:jammy AS builder
ARG MM_VERSION
ENV MM_VERSION=${MM_VERSION}
ARG SENTRY_ENABLED
ENV SENTRY_ENABLED=${SENTRY_ENABLED}
WORKDIR /app
RUN apt-get update && \
apt-get install curl ca-certificates -y --no-install-recommends && \
apt-get clean
ADD "https://github.com/MegaMek/megamek/releases/download/v${MM_VERSION}/megamek-${MM_VERSION}.tar.gz" /tmp/megamek.tar.gz
RUN tar -zxvf /tmp/megamek.tar.gz && mv MegaMek-${MM_VERSION} megamek && \
mv megamek/docs/mm-revision.txt /app/mm-revision.txt && \
rm -rf megamek/data/fonts && \
rm -rf megamek/data/forcegenerator && \
rm -rf megamek/data/images && \
rm -rf megamek/data/names && \
rm -rf megamek/data/rat && \
rm -rf megamek/data/scenarios && \
rm -rf megamek/data/sounds && \
rm -rf megamek/docs && \
mkdir megamek/docs && \
mv /app/mm-revision.txt megamek/docs/mm-revision.txt && \
rm -rf megamek/userdata && \
rm -rf megamek/*.exe && \
rm -rf megamek/*.sh && \
rm megamek/sentry.properties && \
echo "enabled=${SENTRY_ENABLED}" > megamek/sentry.properties
FROM eclipse-temurin:17-noble
WORKDIR /app
EXPOSE 2346
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
&& apt-get clean && \
useradd --user-group --create-home --system --skel /dev/null --home-dir /app megamek
COPY --from=builder --chown=megamek:megamek /app/megamek/ /app/
ENTRYPOINT ["java", "-jar", "MegaMek.jar"]
CMD ["-dedicated", "-port", "2346"]