Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update image to run as a non root user #47

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docker/zomboid-dedicated-server.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#######################################################################

# Base Image
ARG BASE_IMAGE="docker.io/renegademaster/steamcmd-minimal:1.1.2"
ARG BASE_IMAGE="cm2network/steamcmd:latest"

FROM ${BASE_IMAGE}

Expand All @@ -32,14 +32,17 @@ LABEL com.renegademaster.zomboid-dedicated-server.authors="Renegade-Master" \
com.renegademaster.zomboid-dedicated-server.source-repository="https://github.com/Renegade-Master/zomboid-dedicated-server" \
com.renegademaster.zomboid-dedicated-server.image-repository="https://hub.docker.com/renegademaster/zomboid-dedicated-server"

# Copy the source files
COPY src /home/steam/

# Install Python, and take ownership of rcon binary
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-minimal \
python3-minimal \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*

USER steam

# Copy the source files
COPY --chown=steam:steam src /home/steam/

# Run the setup script
ENTRYPOINT ["/bin/bash", "/home/steam/run_server.sh"]
2 changes: 1 addition & 1 deletion src/run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function test_first_run() {
function update_server() {
printf "\n### Updating Project Zomboid Server...\n"

steamcmd.sh +runscript "$STEAM_INSTALL_FILE"
./steamcmd.sh +runscript "$STEAM_INSTALL_FILE"

printf "\n### Project Zomboid Server updated.\n"
}
Expand Down