Ark-docker/Dockerfile

108 lines
2.7 KiB
Text
Raw Normal View History

2020-11-28 20:53:38 +01:00
FROM ubuntu:16.04
2015-09-17 11:21:35 +02:00
MAINTAINER TuRzAm
# Var for first config
# Server Name
ENV SESSIONNAME "Ark Docker"
# Map name
ENV SERVERMAP "TheIsland"
# Server password
ENV SERVERPASSWORD ""
# Admin password
ENV ADMINPASSWORD "adminpassword"
# Nb Players
ENV NBPLAYERS 70
# If the server is updating when start with docker start
ENV UPDATEONSTART 1
# if the server is backup when start with docker start
ENV BACKUPONSTART 1
2016-03-23 16:01:54 +01:00
# Tag on github for ark server tools
2020-11-28 20:34:45 +01:00
ENV GIT_TAG v1.6.56
2015-09-18 10:53:45 +02:00
# Server PORT (you can't remap with docker, it doesn't work)
ENV SERVERPORT 27015
# Steam port (you can't remap with docker, it doesn't work)
ENV STEAMPORT 7778
2016-03-23 15:31:28 +01:00
# if the server should backup after stopping
ENV BACKUPONSTOP 0
# If the server warn the players before stopping
ENV WARNONSTOP 0
2016-07-08 16:12:46 +02:00
# UID of the user steam
ENV UID 1000
# GID of the user steam
ENV GID 1000
2015-09-17 11:21:35 +02:00
# Install dependencies
RUN apt-get update &&\
2020-11-28 21:29:28 +01:00
apt-get install -y curl lib32gcc1 lsof git sudo
2015-09-17 11:21:35 +02:00
# Enable passwordless sudo for users under the "sudo" group
RUN sed -i.bkp -e \
's/%sudo\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%sudo ALL=NOPASSWD:ALL/g' /etc/sudoers \
/etc/sudoers
2015-09-17 11:21:35 +02:00
# Run commands as the steam user
RUN adduser \
--disabled-login \
--shell /bin/bash \
--gecos "" \
steam
# Add to sudo group
RUN usermod -a -G sudo steam
2015-09-17 11:21:35 +02:00
# Copy & rights to folders
COPY run.sh /home/steam/run.sh
2016-07-08 16:12:46 +02:00
COPY user.sh /home/steam/user.sh
COPY crontab /home/steam/crontab
2015-09-18 10:53:45 +02:00
COPY arkmanager-user.cfg /home/steam/arkmanager.cfg
2015-09-17 11:21:35 +02:00
2016-07-08 16:12:46 +02:00
RUN touch /root/.bash_profile
2015-09-17 11:21:35 +02:00
RUN chmod 777 /home/steam/run.sh
2016-07-08 16:12:46 +02:00
RUN chmod 777 /home/steam/user.sh
2015-09-17 11:21:35 +02:00
RUN mkdir /ark
# We use the git method, because api github has a limit ;)
2016-03-23 16:01:54 +01:00
RUN git clone https://github.com/FezVrasta/ark-server-tools.git /home/steam/ark-server-tools
WORKDIR /home/steam/ark-server-tools/
RUN git checkout $GIT_TAG
2015-09-17 11:21:35 +02:00
# Install
WORKDIR /home/steam/ark-server-tools/tools
RUN chmod +x install.sh
RUN ./install.sh steam
# Allow crontab to call arkmanager
RUN ln -s /usr/local/bin/arkmanager /usr/bin/arkmanager
2016-03-23 15:31:28 +01:00
# Define default config file in /etc/arkmanager
2015-09-18 10:53:45 +02:00
COPY arkmanager-system.cfg /etc/arkmanager/arkmanager.cfg
2015-09-17 11:21:35 +02:00
2016-03-23 15:31:28 +01:00
# Define default config file in /etc/arkmanager
COPY instance.cfg /etc/arkmanager/instances/main.cfg
2015-09-17 11:21:35 +02:00
RUN chown steam -R /ark && chmod 755 -R /ark
2016-07-08 16:12:46 +02:00
#USER steam
2015-09-17 11:21:35 +02:00
# download steamcmd
RUN mkdir /home/steam/steamcmd &&\
cd /home/steam/steamcmd &&\
curl http://media.steampowered.com/installer/steamcmd_linux.tar.gz | tar -vxz
# First run is on anonymous to download the app
# We can't download from docker hub anymore -_-
#RUN /home/steam/steamcmd/steamcmd.sh +login anonymous +quit
2015-09-17 11:21:35 +02:00
2015-09-18 10:53:45 +02:00
EXPOSE ${STEAMPORT} 32330 ${SERVERPORT}
2016-07-07 16:35:42 +02:00
# Add UDP
EXPOSE ${STEAMPORT}/udp ${SERVERPORT}/udp
2015-09-17 11:21:35 +02:00
VOLUME /ark
# Change the working directory to /arkd
WORKDIR /ark
2015-09-17 11:21:35 +02:00
# Update game launch the game.
2016-07-08 16:12:46 +02:00
ENTRYPOINT ["/home/steam/user.sh"]