tools/ci: Create a github user instead of a circleci user.

While we are making this change, we create a ARG USERNAME variable
that behaves like ENV but just for the lifetime of the Dockerfile.
This commit is contained in:
Priyank Patel
2020-06-26 18:41:34 +00:00
committed by Tim Abbott
parent a2c2c6ceff
commit 92f98292c1

View File

@@ -96,11 +96,12 @@ RUN apt-get update \
libxml2-dev libxslt1-dev libpq-dev \
{extra_packages}
RUN groupadd --gid 3434 circleci \
&& useradd --uid 3434 --gid circleci --shell /bin/bash --create-home circleci \
&& echo 'circleci ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers.d/50-circleci \
ARG USERNAME=github
RUN groupadd --gid 3434 $USERNAME \
&& useradd --uid 3434 --gid $USERNAME --shell /bin/bash --create-home $USERNAME \
&& echo "$USERNAME ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers.d/50-$USERNAME \
&& echo 'Defaults env_keep += "DEBIAN_FRONTEND"' >> /etc/sudoers.d/env_keep
USER circleci
USER $USERNAME
CMD ["/bin/sh"]