summaryrefslogtreecommitdiffstats
path: root/container/Dockerfile
diff options
context:
space:
mode:
authordev <dev@example>2026-11-15 13:54:31 +0000
committerdev <dev@example>2026-11-15 13:54:31 +0000
commitda06d4f56afa72ae832238f91358b9aeaeaf0da5 (patch)
tree7ead0d915bf4e388dcc55d3b63b4fc0628ef895b /container/Dockerfile
parent85b7fa7f8456c84f65a0d81b760c430098ae7fd8 (diff)
downloadaccess-control-da06d4f56afa72ae832238f91358b9aeaeaf0da5.tar.gz
access-control-da06d4f56afa72ae832238f91358b9aeaeaf0da5.zip
Only build the access control executableHEADmain
The container image and all the server configuration (Dockerfile, entrypoint, cgitrc, sshd, lighttpd, create-repo, git-host-key) move to the git-host project. This repo is now just the program: cmd/, src/, test/, the Makefile that builds git-authz and installs it, and the example policy - the same cmd/src/test/obj layout the reference projects use. The CI pipeline keeps the compile-and-test gate (strict, test, sanitizer, install) and drops the container-build job, which belongs to git-host now.
Diffstat (limited to 'container/Dockerfile')
-rw-r--r--container/Dockerfile86
1 files changed, 0 insertions, 86 deletions
diff --git a/container/Dockerfile b/container/Dockerfile
deleted file mode 100644
index 53b153e..0000000
--- a/container/Dockerfile
+++ /dev/null
@@ -1,86 +0,0 @@
-# podman build -t git-host-c -f container/Dockerfile .
-#
-# Two stages: the runtime image carries no compiler, and copies what `make
-# install` staged, so image paths cannot drift from build paths.
-#
-# The build stage is Alpine so the binary is musl-linked like the rest of the
-# image. A glibc binary reports "no such file" for a file that is plainly there.
-
-
-FROM alpine:3.22.4 AS build
-RUN apk add --no-cache build-base
-WORKDIR /src
-COPY Makefile README authz.conf ./
-COPY src ./src
-COPY cmd ./cmd
-COPY test ./test
-COPY build ./build
-# The suite runs against the musl build, which is the only place the two meet.
-
-RUN make -j2 && make test && make install DESTDIR=/install
-
-
-FROM alpine:3.22.4
-
-# git-daemon is not a typo: it is the package that ships git-http-backend and
-# git-shell.
-RUN apk add --no-cache \
- cgit \
- git \
- git-daemon \
- lighttpd \
- lighttpd-mod_auth \
- openssh-server \
- tini
-
-RUN addgroup -g 1000 -S git \
- && adduser -u 1000 -S -D -G git -h /var/lib/git -s /usr/bin/git-shell git \
- && adduser git tty \
- && passwd -u git \
- && mkdir -p \
- /etc/git-host/secrets \
- /usr/local/libexec \
- /var/lib/git \
- /run/git-host/secrets \
- /run/lighttpd \
- /run/sshd \
- /var/tmp/lighttpd \
- /var/www/localhost/htdocs \
- && chown -R git:git /var/lib/git
-
-# Placed by the program's own installer.
-
-COPY --from=build /install/ /
-
-COPY container/create-repo /usr/local/bin/create-repo
-COPY container/git-host-key /usr/local/bin/git-host-key
-COPY container/entrypoint.sh /usr/local/bin/entrypoint.sh
-
-# mod_cgi dispatches by extension, so /git needs a *.cgi door onto the stock
-# backend. It must not touch the environment: REMOTE_USER is the identity.
-
-COPY container/git-http-backend.cgi /usr/local/libexec/git-http-backend.cgi
-
-COPY container/sshd_config /etc/ssh/sshd_config
-COPY container/cgitrc /etc/cgitrc
-COPY container/lighttpd.conf /etc/lighttpd/lighttpd.conf
-COPY container/auth.conf /etc/lighttpd/auth.conf
-COPY container/healthz /var/www/localhost/htdocs/healthz
-
-RUN chmod 0755 \
- /usr/local/bin/entrypoint.sh \
- /usr/local/bin/git-host-key \
- /usr/local/bin/create-repo \
- /usr/local/libexec/git-http-backend.cgi \
- && chmod 0644 /etc/git-host/authz.conf \
- && chown git:git /var/lib/git /run/lighttpd /var/tmp/lighttpd /var/www/localhost/htdocs \
- && chmod 0755 /run/git-host /run/git-host/secrets \
- && git config --file /etc/gitconfig core.hooksPath /usr/local/share/git-host/hooks \
- && grep -q "^git:" /etc/passwd \
- && lighttpd -tt -f /etc/lighttpd/lighttpd.conf \
- && /usr/local/bin/git-authz validate
-
-EXPOSE 8080 2222
-VOLUME ["/var/lib/git"]
-
-ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]