Use dumb-init to handle signal properly

This commit is contained in:
Moto Ishizawa 2020-02-06 18:47:50 +09:00
parent f5c8a0e655
commit c66916a4ee
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,8 @@ RUN apt update \
&& 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 \
&& chmod +x /usr/local/bin/dumb-init \
&& adduser --disabled-password --gecos "" --uid 1000 runner && adduser --disabled-password --gecos "" --uid 1000 runner
RUN mkdir -p /runner \ RUN mkdir -p /runner \
@ -21,4 +23,5 @@ RUN mkdir -p /runner \
COPY entrypoint.sh /runner COPY entrypoint.sh /runner
USER runner:runner USER runner:runner
ENTRYPOINT ["/runner/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
CMD ["/runner/entrypoint.sh"]

View File

@ -17,4 +17,4 @@ fi
cd /runner cd /runner
./config.sh --unattended --replace --name "${RUNNER_NAME}" --url "https://github.com/${RUNNER_REPO}" --token "${RUNNER_TOKEN}" ./config.sh --unattended --replace --name "${RUNNER_NAME}" --url "https://github.com/${RUNNER_REPO}" --token "${RUNNER_TOKEN}"
./run.sh --once exec ./run.sh --once