From 8112e8ee15140186508c85ea6d50d9de39c30eca 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 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Dockerfile b/src/Dockerfile index 96dfb06..832e83e 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 + + # Create steam user +RUN useradd -ms /bin/bash steam \ + # Ensure steam user got permission + && mkdir /conanexiles /steamcmd /wine \ + && chown steam /conanexiles /steamcmd /wine + +USER steam 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 - + EXPOSE 7777/udp 27015/udp 27016/udp 37015/udp 37016/udp VOLUME ["/conanexiles"]