Add runner user to sudo group

This commit is contained in:
Vito Botta 2020-03-31 13:55:38 +03:00 committed by KUOKA Yusuke
parent b8b4ef4b60
commit f2dcb5659d
1 changed files with 4 additions and 2 deletions

View File

@ -4,14 +4,16 @@ ARG RUNNER_VERSION
ARG DOCKER_VERSION ARG DOCKER_VERSION
RUN apt update \ RUN apt update \
&& apt install curl ca-certificates -y --no-install-recommends \ && apt install sudo curl ca-certificates -y --no-install-recommends \
&& curl -L -o docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \ && curl -L -o docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VERSION}.tgz \
&& tar zxvf docker.tgz \ && tar zxvf docker.tgz \
&& install -o root -g root -m 755 docker/docker /usr/local/bin/docker \ && install -o root -g root -m 755 docker/docker /usr/local/bin/docker \
&& rm -rf docker docker.tgz \ && rm -rf docker docker.tgz \
&& curl -L -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 \ && curl -L -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64 \
&& chmod +x /usr/local/bin/dumb-init \ && chmod +x /usr/local/bin/dumb-init \
&& adduser --disabled-password --gecos "" --uid 1000 runner && adduser --disabled-password --gecos "" --uid 1000 runner \
&& usermod -aG sudo runner \
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD:ALL" > /etc/sudoers
RUN mkdir -p /runner \ RUN mkdir -p /runner \
&& cd /runner \ && cd /runner \