Created
March 2, 2022 17:57
-
-
Save thomaslorentsen/4a0f4ba1ab7b65bb9d6d2cf865933198 to your computer and use it in GitHub Desktop.
Jenkins Agent with Docker installed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM jenkins/agent:latest-jdk11 | |
USER root | |
RUN apt-get update \ | |
&& apt-get install -y \ | |
curl \ | |
unzip \ | |
rsync \ | |
apt-transport-https \ | |
lsb-release \ | |
ca-certificates \ | |
sudo \ | |
gnupg \ | |
iptables \ | |
libdevmapper1.02.1 \ | |
libgtk2.0-0 \ | |
libgtk-3-0 \ | |
libgbm-dev \ | |
libnotify-dev \ | |
libgconf-2-4 \ | |
libnss3 \ | |
libxss1 \ | |
libasound2 \ | |
libxtst6 \ | |
make \ | |
xauth \ | |
xvfb | |
RUN curl -fsSL -o containerd.io.deb https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64/containerd.io_1.4.9-1_amd64.deb \ | |
&& curl -fsSL -o docker-ce-cli.deb https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64/docker-ce-cli_20.10.8~3-0~debian-buster_amd64.deb \ | |
&& curl -fsSL -o docker-ce.deb https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64/docker-ce_20.10.8~3-0~debian-buster_amd64.deb \ | |
&& dpkg -i containerd.io.deb \ | |
docker-ce-cli.deb \ | |
docker-ce.deb \ | |
&& usermod -a -G docker jenkins \ | |
&& echo "ALL ALL=NOPASSWD: /usr/bin/docker" > /etc/sudoers.d/docker \ | |
&& rm containerd.io.deb docker-ce-cli.deb docker-ce.deb | |
ENV DOCKER_COMPOSE_VERSION 1.29.2 | |
RUN curl -L "https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose \ | |
&& chmod +x /usr/local/bin/docker-compose \ | |
&& ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | |
USER jenkins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment