jenkins-docker/Dockerfile

56 lines
1.7 KiB
Docker

FROM jenkins/jenkins:lts
MAINTAINER Ben Kristinsson <systems@sudo.si>
ENV TERM=xterm-256color
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV SUDOIS_JENKINS_VERSION ${JENKINS_VERSION}
ARG SUDOIS_JENKINS_UID=1207
ARG SUDOIS_JENKINS_GID=1207
ARG DOCKER_SOCK_GID=134
USER root
COPY --chown=root:root etc/apt/keyrings/docker.asc /etc/apt/keyrings/docker.asc
COPY --chown=root:root etc/apt/sources.list.d/docker.list /etc/apt/sources.list.d/
RUN set -x && \
groupmod -g ${SUDOIS_JENKINS_GID} jenkins && \
groupadd docker --gid ${DOCKER_SOCK_GID} && \
usermod jenkins \
--uid ${SUDOIS_JENKINS_UID} \
--gid ${SUDOIS_JENKINS_GID} \
--home /var/jenkins_home \
--groups docker && \
# This wasnt needed before (see commit: 762747332ea084826b71adb3b8d7cc5455d3350f).. \
chgrp -R jenkins /var/jenkins_home && \
apt-get update && \
apt-get remove -y docker.io docker-doc docker-compose podman-docker containerd runc && \
apt-get install -y sudo tree jq \
# Docker tooling \
docker-ce-cli docker-buildx-plugin \
# Build tools \
build-essential \
dpkg-dev debdelta \
# apt-ftparchive etc \
apt-utils ca-certificates software-properties-common \
# Python \
python3 python3-pip python3-dev python3-venv \
pipx \
# Old rust \
rust-all \
# Ruby (for fpm) \
ruby ruby-dev rubygems && \
apt-get autoremove -y && \
apt-get autoclean -y && \
apt-get clean -y && \
gem install --no-document fpm
USER jenkins
RUN set -x && \
pipx install poetry && \
pipx install hatch && \
pipx install httpie && \
pipx install esphome