Skip to content
Snippets Groups Projects
Commit 8d4cb7a6 authored by Markus Frosch's avatar Markus Frosch
Browse files

Switch to user build and set USER

parent e40bc121
No related branches found
No related tags found
No related merge requests found
Pipeline #5257 passed
...@@ -13,11 +13,6 @@ RUN apt-get update \ ...@@ -13,11 +13,6 @@ RUN apt-get update \
&& rm -rf /usr/share/doc/* /usr/share/locales/* /usr/share/man/* \ && rm -rf /usr/share/doc/* /usr/share/locales/* /usr/share/man/* \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN groupadd -g 1000 jenkins \
&& useradd -u 1000 -g 1000 -m jenkins \
&& echo 'Defaults:jenkins !requiretty' | tee -a /etc/sudoers \
&& echo 'jenkins ALL=(ALL:ALL) NOPASSWD: ALL' | tee -a /etc/sudoers
RUN curl https://packages.icinga.com/icinga.key | apt-key add - \ RUN curl https://packages.icinga.com/icinga.key | apt-key add - \
&& DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) \ && DIST=$(awk -F"[)(]+" '/VERSION=/ {print $2}' /etc/os-release) \
&& echo "deb http://packages.icinga.com/raspbian icinga-${DIST} main" > /etc/apt/sources.list.d/${DIST}-icinga.list && echo "deb http://packages.icinga.com/raspbian icinga-${DIST} main" > /etc/apt/sources.list.d/${DIST}-icinga.list
...@@ -30,6 +25,13 @@ RUN apt-get update \ ...@@ -30,6 +25,13 @@ RUN apt-get update \
php-cli php-htmlpurifier node-uglify \ php-cli php-htmlpurifier node-uglify \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN groupadd -g 1000 build \
&& useradd -u 1000 -g 1000 -m build \
&& echo 'Defaults:build !requiretty' | tee -a /etc/sudoers \
&& echo 'build ALL=(ALL:ALL) NOPASSWD: ALL' | tee -a /etc/sudoers \
&& chown build.build /usr/local/bin
USER build
RUN git clone https://git.icinga.com/build-docker/scripts.git /usr/local/bin RUN git clone https://git.icinga.com/build-docker/scripts.git /usr/local/bin
ENTRYPOINT ["/usr/local/bin/icinga-build-entrypoint"] ENTRYPOINT ["/usr/local/bin/icinga-build-entrypoint"]
CMD ["icinga-build-package"] CMD ["icinga-build-package"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment