deploy/Containerfile.ci

8dcfa45a8ac03a5ff9c36828274d05acadcf846c
gitbay/deploy/Containerfile.ci history · blame · raw

41 lines · 1982 bytes

 1# The image gitbay's own CI jobs run in, once the runner isolates builds
 2# (#144). Without it a job runs in the runner's default image, which has
 3# no toolchain, and the suite's prerequisite check fails immediately.
 4#
 5# Build it on the runner host, where podman keeps it. The file is staged in
 6# the runner user's home first: a login shell under su cannot read root's
 7# stdin, and root's session does not share /tmp with it.
 8#
 9#   scp -P 2222 deploy/Containerfile.ci root@gitbay.org:/var/lib/gitbay-runner/gitbay-ci.Containerfile
10#   ssh -p 2222 root@gitbay.org 'chown ci-runner /var/lib/gitbay-runner/gitbay-ci.Containerfile \
11#     && su - ci-runner -s /bin/sh -c "podman build -t localhost/gitbay-ci:2 -f gitbay-ci.Containerfile ." \
12#     && rm /var/lib/gitbay-runner/gitbay-ci.Containerfile'
13#
14# Tagged, not :latest, so a change to this file is a deliberate bump in
15# .gitbay/ci.yml rather than a silent change under a running branch.
16FROM docker.io/library/golang:1.27-trixie
17
18# The suite drives real git, ssh, sshd and gpg rather than mocking them,
19# and asserts they are present before running. git-lfs has its own tests;
20# sshd must be the binary at /usr/sbin/sshd that the tests exec.
21# python3-venv: this is also the default image for every repository the
22# bay1 runner is attached to, and a lint job that makes a venv for ruff
23# fails without ensurepip (gitbay-ci:2). sqlite3: the same reason, for
24# a job that maintains an archive database.
25RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
26        git-lfs \
27        gnupg \
28        openssh-server \
29        openssh-client \
30        ca-certificates \
31        curl \
32        unzip \
33        python3 \
34        python3-venv \
35        sqlite3 \
36    && rm -rf /var/lib/apt/lists/*
37
38# A build runs as this image's root inside its own user namespace, mapped
39# to the runner's unprivileged user on the host. The workspace arrives
40# bind mounted at /workspace.
41WORKDIR /workspace