-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_post0.50.01
34 lines (30 loc) · 1.58 KB
/
Dockerfile_post0.50.01
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
# Use recomended for MegaMek Java 17 distribution offcial image.
FROM eclipse-temurin:17.0.11_9-jre-jammy
# Set MegaMek version
ARG VERSION=0.50.01
RUN cd /srv && \
# Download desired MegaMek release
wget https://github.com/MegaMek/mekhq/releases/download/v${VERSION}/MekHQ-${VERSION}.tar.gz && \
tar -zxvf MekHQ-${VERSION}.tar.gz && \
rm MekHQ-${VERSION}.tar.gz && \
mv MekHQ-${VERSION} mekhq && \
# Make shared folder for custom assets to use it as Volume
mkdir -p /srv/shared/boards /srv/shared/images /srv/shared/mekfiles /srv/shared/scenarios /srv/shared/forcegenerator /srv/shared/mapgen /srv/shared/names /srv/shared/rat /srv/shared/sounds && \
ln -s /srv/shared/boards /srv/mekhq/data/boards/custom && \
ln -s /srv/shared/images /srv/mekhq/data/images/custom && \
ln -s /srv/shared/mekfiles /srv/mekhq/data/mekfiles/custom && \
ln -s /srv/shared/scenarios /srv/mekhq/data/scenarios/custom && \
ln -s /srv/shared/forcegenerator /srv/mekhq/data/forcegenerator/custom && \
ln -s /srv/shared/mapgen /srv/mekhq/data/mapgen/custom && \
ln -s /srv/shared/names /srv/mekhq/data/names/custom && \
ln -s /srv/shared/rat /srv/mekhq/data/rat/custom && \
ln -s /srv/shared/sounds /srv/mekhq/data/sounds/custom
# Define Volume with shared custom assets
VOLUME ["/srv/shared"]
# Set server port. I suggest leaving it here, and changing diferent in docker port binding if desired.
EXPOSE 2346
# Set desired memory limit in megabytes and password
ENV MEMORY=768
ENV PASSWORD=megamek
WORKDIR srv/mekhq
CMD ["sh", "-c", "java -Xms${MEMORY}m -Xmx${MEMORY}m -jar MegaMek.jar -dedicated -port 2346 -password ${PASSWORD}"]