Files
k3s-gitops/apps/jenkins/Dockerfile

42 lines
1.2 KiB
Docker

FROM jenkins/jenkins:lts-jdk17
USER root
# Install Docker CLI
RUN apt-get update && \
apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install -y docker-ce-cli && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
chmod +x kubectl && \
mv kubectl /usr/local/bin/
# Install git (if not already)
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
USER jenkins
# Pre-install useful plugins
RUN jenkins-plugin-cli --plugins \
git \
docker-workflow \
pipeline-stage-view \
kubernetes \
configuration-as-code \
job-dsl \
workflow-aggregator \
gitea