Docker: Add Jenkins user in Arch Linux image
@@ -21,3 +21,21 @@ RUN mkdir -p ${GTEST_ROOT} \
-L https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz \
&& tar -zxvf gtest.tar.gz --strip-components=1 -C ${GTEST_ROOT} \
&& rm gtest.tar.gz
+
+# Create User:Group
+# The id is important as jenkins docker agents use the same id that is running
+# on the slaves to execute containers
+ARG JENKINS_GROUPID
+RUN groupadd \
+ -g ${JENKINS_GROUPID} \
+ -f \
+ jenkins
+
+ARG JENKINS_USERID
+RUN useradd \
+ --create-home \
+ --uid ${JENKINS_USERID} \
+ --gid ${JENKINS_GROUPID} \
+ --shell "/bin/bash" \
+ jenkins
+USER ${JENKINS_USERID}
