diff options
Diffstat (limited to 'Dockerfile.jenkins')
| -rw-r--r-- | Dockerfile.jenkins | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/Dockerfile.jenkins b/Dockerfile.jenkins deleted file mode 100644 index 23a95f1..0000000 --- a/Dockerfile.jenkins +++ /dev/null @@ -1,40 +0,0 @@ -# Dockerfile.jenkins
-# Use the official Jenkins image as a base
-FROM jenkins/jenkins:lts-jdk17
-
-# Pass Host User, Group, and Docker Group IDs as build arguments
-ARG UID
-ARG GID
-ARG DOCKER_GID
-
-# Switch to root user to install dependencies and manage users
-USER root
-
-# Install Docker CLI so Jenkins can interact with the host's Docker daemon
-RUN apt-get update && apt-get install -y lsb-release sudo
-RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
- https://download.docker.com/linux/debian/gpg
-RUN echo "deb [arch=$(dpkg --print-architecture) \
- signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
- https://download.docker.com/linux/debian \
- $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
-RUN apt-get update && apt-get install -y docker-ce-cli
-
-# Create a docker group with the host's GID to match permissions
-# and add the jenkins user to it.
-RUN if [ -n "$DOCKER_GID" ]; then \
- groupadd -g $DOCKER_GID docker && \
- usermod -aG docker jenkins; \
- fi
-
-# Change the jenkins user and group to match the host.
-# This should ensure file permissions for the jenkins_home volume are correct.
-RUN if [ -n "$GID" ] && [ "$(getent group jenkins | cut -d: -f3)" != "$GID" ]; then \
- groupmod -g $GID jenkins; \
- fi
-RUN if [ -n "$UID" ] && [ "$(id -u jenkins)" != "$UID" ]; then \
- usermod -u $UID jenkins; \
- fi
-
-# Switch to the newly configured jenkins user
-USER jenkins
|
