dayzdockerserver/Dockerfile
Daniel Ceregatti 164d5b41d6 Add more interactive functionality: Login, update, rcon, etc. All WIPs.
Simplify things by consolidating all the bash stuff into dayzserver and removing files where the content has become managed interactively.
Make sure steamcmd has proper permissions in the container.
More updated documentation.
2022-03-26 16:37:39 -07:00

61 lines
1.5 KiB
Docker

FROM debian:bullseye
# Replace shell with bash so we can source files
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
# Set debconf to run non-interactively
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Add contrib and backports
RUN sed -i /etc/apt/sources.list -e 's/main/main contrib/'
#RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' >> /etc/apt/sources.list
# Add 32 bit arch for steam crap
RUN dpkg --add-architecture i386
# Install necessary packages
RUN apt-get update && apt-get -y upgrade && apt-get -y install \
nano \
curl \
lib32gcc-s1 \
lib32stdc++6 \
libcap2 \
locales \
psmisc \
wget \
rename
# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Add steamcmd to the image.
RUN mkdir -p /steamcmd && \
cd /steamcmd && \
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxf -
# Make our docker scripts easier to run
ENV PATH /files:/steamcmd:${PATH}
# Setup a non-privileged user
RUN groupadd user && \
useradd -l -m -g user user
# The volume needs to be owned by the user
RUN cd /home/user; rm -rf *; rm -rf .*; chown user:user /home/user -R
# SteamCMD wants to manage itself, so it has to be owned by the docker user.
RUN chown user:user /steamcmd -R
# Use our non-privileged user
USER user
# The dayzserver script expects a home directory to itself.
WORKDIR /home/user
# Run the server.
CMD ["dayzserver", "start"]