From 94310486a607a2a8d076ac0f31065bc4729a9599 Mon Sep 17 00:00:00 2001 From: TBK Date: Fri, 29 Mar 2019 20:14:36 +0100 Subject: [PATCH] Run as non-root #10 https://github.com/alinmear/docker-conanexiles/issues/10 --- src/Dockerfile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/Dockerfile b/src/Dockerfile index 96dfb06..99e899f 100644 --- a/src/Dockerfile +++ b/src/Dockerfile @@ -20,16 +20,24 @@ RUN dpkg --add-architecture i386 \ && apt-get install --no-install-recommends --assume-yes winehq-staging \ && pip3 install python-valve \ && apt-get clean \ - && rm -rf winehq.key /var/lib/apt/lists/* /tmp/* /var/tmp/* + && rm -rf winehq.key /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \ + && echo $TIMEZONE > /etc/timezone COPY . ./ -RUN ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \ - && echo $TIMEZONE > /etc/timezone \ - && chmod +x /entrypoint.sh \ +RUN chmod +x /entrypoint.sh \ && cd /usr/bin/ \ - && chmod +x conanexiles_controller rconcli steamcmd_setup - + && chmod +x conanexiles_controller rconcli steamcmd_setup \ + # Create steam user and group + && useradd -ms /bin/bash steam \ + # Ensure steam user got permission + && touch /bash.bashrc \ + && mkdir /conanexiles /steamcmd /wine \ + && chown steam -cR /conanexiles /steamcmd /wine /bash.bashrc /etc/supervisor/conf.d/ + +USER steam + EXPOSE 7777/udp 27015/udp 27016/udp 37015/udp 37016/udp VOLUME ["/conanexiles"]