builder-netstandard: attempt to run groupadd and useradd in the stage
Project: http://git-wip-us.apache.org/repos/asf/logging-log4net/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4net/commit/0c823141 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4net/tree/0c823141 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4net/diff/0c823141 Branch: refs/heads/feature/RollingFileAppender-NG Commit: 0c823141199e548a1be57cb0bca195e07afac922 Parents: 1beaeae Author: Dominik Psenner <dpsen...@apache.org> Authored: Sun Jul 9 18:00:32 2017 +0200 Committer: Dominik Psenner <dpsen...@apache.org> Committed: Sun Jul 9 18:00:32 2017 +0200 ---------------------------------------------------------------------- Jenkinsfile | 5 +++++ buildtools/docker/builder-netstandard/Dockerfile | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/0c823141/Jenkinsfile ---------------------------------------------------------------------- diff --git a/Jenkinsfile b/Jenkinsfile index df9c3d5..df47822 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -47,6 +47,11 @@ pipeline { WORKSPACE = '/var/workspaces/jenkins' } steps { + // create a jenkins user for dotnet to consume + sh 'sudo groupadd -r -g `id -g` jenkins-slave' + sh 'sudo useradd --base-dir /var/workspaces --create-home --shell /bin/bash --uid `id -u` --gid `id -g` --groups `id -g` -p jenkins' + + // checkout checkout scm // compile http://git-wip-us.apache.org/repos/asf/logging-log4net/blob/0c823141/buildtools/docker/builder-netstandard/Dockerfile ---------------------------------------------------------------------- diff --git a/buildtools/docker/builder-netstandard/Dockerfile b/buildtools/docker/builder-netstandard/Dockerfile index e00b1f2..ba0cde9 100644 --- a/buildtools/docker/builder-netstandard/Dockerfile +++ b/buildtools/docker/builder-netstandard/Dockerfile @@ -5,12 +5,12 @@ FROM microsoft/dotnet MAINTAINER "d...@logging.apache.org" # install dependencies -RUN apt-get update && apt-get install -y nant git +RUN apt-get update && apt-get install -y nant git sudo # add custom workspace that can be written by anyone RUN mkdir -p /var/workspaces && chmod 0777 /var/workspaces -# add jenkins user that maps to the custom workspace -RUN groupadd -r -g 12040 jenkins-slave -RUN useradd --base-dir /var/workspaces --create-home --shell /bin/bash --uid 10025 --gid 12040 --groups 12040 -p -M jenkins +# allow every user to run groupadd and useradd +RUN echo "ALL ALL=NOPASSWD: /usr/sbin/groupadd" >> /etc/sudoers +RUN echo "ALL ALL=NOPASSWD: /usr/sbin/useradd" >> /etc/sudoers