aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/debian/Dockerfile
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-10-04 21:38:14 +0500
committerEgor Tensin <egor@tensin.name>2026-10-04 21:38:14 +0500
commiteb71c13f3bb0ca9ae2084a2b986f915d15f0ac65 (patch)
treea6ac5789a715ca475d7911c10d13cf611ea3b259 /debian/Dockerfile
parentworkflows: add some comments (diff)
downloadlinux-status-eb71c13f3bb0ca9ae2084a2b986f915d15f0ac65.tar.gz
linux-status-eb71c13f3bb0ca9ae2084a2b986f915d15f0ac65.zip
debian: ditch Vagrant, switch to Docker
Diffstat (limited to 'debian/Dockerfile')
-rw-r--r--debian/Dockerfile52
1 files changed, 52 insertions, 0 deletions
diff --git a/debian/Dockerfile b/debian/Dockerfile
new file mode 100644
index 0000000..c29c56e
--- /dev/null
+++ b/debian/Dockerfile
@@ -0,0 +1,52 @@
+FROM ubuntu:focal
+
+ENV GPG_KEY="09AEA2BAD52882A1AF9D6042F218DB829A9905B5"
+ENV DEBFULLNAME="Egor Tensin"
+ENV DEBEMAIL="egor@tensin.name"
+
+ARG UID=1000
+ARG GID=1000
+
+RUN if ! id -n -g "$GID" ; then \
+ groupadd -g "$GID" builder ; \
+ fi
+
+RUN if ! id -n -u "$UID" ; then \
+ useradd -u "$UID" -g "$GID" --shell /bin/bash --create-home builder && \
+ passwd -d builder ; \
+ fi
+
+RUN apt update && \
+ DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
+ dirmngr \
+ gpg \
+ gpg-agent \
+ git \
+ make \
+ sudo
+
+# I'd prefer to run everything as root, but some bright person decided to
+# hardcode sudo usage in git-pbuilder (https://manpages.org/git-pbuilder):
+#
+# > In this case, it calls cowbuilder (or the configured builder as described above) _using sudo_
+#
+RUN echo 'ALL ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers
+
+COPY ["prelude.mk", "/"]
+COPY ["debian/Makefile", "/deps/"]
+RUN make -C /deps deps
+
+USER "$UID:$GID"
+
+RUN git config --global user.name "$DEBFULLNAME" && \
+ git config --global user.email "$DEBEMAIL"
+
+ENV GNUPGHOME=/tmp/gnupg
+RUN mkdir -p -- "$GNUPGHOME" && \
+ chmod 0700 "$GNUPGHOME"
+
+RUN gpg --keyserver hkp://keyserver.ubuntu.com/ --recv-keys "0x$GPG_KEY" && \
+ echo "$GPG_KEY:6:" | gpg --import-ownertrust
+
+COPY [".", "/app"]
+WORKDIR /app/debian