Skip to content

Commit

Permalink
Docker image user permissions fix (#1373) + got rid of empty continua…
Browse files Browse the repository at this point in the history
…tion line warning
  • Loading branch information
rafzei committed Jun 23, 2020
1 parent 3c856a6 commit e49e852
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/src/epicli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ARG EPICLI_VERSION
ARG USERNAME=epiuser
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG SHARED_DIR=/shared

ENV DOCKER_CLI Yes

Expand All @@ -14,23 +15,24 @@ WORKDIR /epicli
RUN apt-get update \
&& apt-get -y install gcc make musl-dev libffi-dev tar unzip openssh-client vim \
&& apt-get -y install ruby-full \
&& gem install serverspec rake rspec_junit_formatter
&& gem install serverspec rake rspec_junit_formatter

RUN pip install epicli-${EPICLI_VERSION}-py3-none-any.whl

RUN groupadd --gid $USER_GID $USERNAME \
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get install -y sudo \

&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \

&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*

RUN mkdir $SHARED_DIR \
;chown :$USERNAME $SHARED_DIR \
&& chmod g+w $SHARED_DIR

RUN mkdir /shared/
WORKDIR /shared
WORKDIR $SHARED_DIR

USER $USERNAME

Expand Down

0 comments on commit e49e852

Please sign in to comment.