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

Switch to build user and set USER

parent 5e6f0856
No related branches found
No related tags found
No related merge requests found
...@@ -18,14 +18,16 @@ RUN dnf install -y --allowerasing \ ...@@ -18,14 +18,16 @@ RUN dnf install -y --allowerasing \
&& rm -rf /var/lib/dnf/* \ && rm -rf /var/lib/dnf/* \
&& rm -f /var/lib/rpm/.*.lock && rm -f /var/lib/rpm/.*.lock
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 wget -O /etc/yum.repos.d/ICINGA-release.repo \ RUN wget -O /etc/yum.repos.d/ICINGA-release.repo \
https://packages.icinga.com/fedora/ICINGA-release.repo https://packages.icinga.com/fedora/ICINGA-release.repo
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"]
...@@ -9,14 +9,16 @@ RUN dnf install -y --allowerasing \ ...@@ -9,14 +9,16 @@ RUN dnf install -y --allowerasing \
dnf-utils rpmdevtools createrepo \ dnf-utils rpmdevtools createrepo \
&& dnf clean all && dnf clean all
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 wget -O /etc/yum.repos.d/ICINGA-release.repo \ RUN wget -O /etc/yum.repos.d/ICINGA-release.repo \
https://packages.icinga.com/fedora/ICINGA-release.repo https://packages.icinga.com/fedora/ICINGA-release.repo
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