Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/docker-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ jobs:
TAGS="${IMAGE}:sha-${RELAY_SHA_SHORT}"
if [ "$EVENT_NAME" = "push" ] || \
[ "$EVENT_NAME" = "pull_request" ]; then
# Docker-repo push/PR: add docker branch tag
TAGS="${TAGS}"$'\n'"${IMAGE}:${REF_NAME}"
# Docker-repo push/PR: add docker branch tag (sanitize slashes)
BRANCH_TAG=$(echo "${REF_NAME}" | sed 's|/|-|g')
TAGS="${TAGS}"$'\n'"${IMAGE}:${BRANCH_TAG}"
else
# Dispatch: tags based on relay ref
BRANCH_TAG=$(echo "${RELAY_REF}" | sed 's|/|-|g')
Expand Down Expand Up @@ -206,7 +207,6 @@ jobs:
name: Integration test
needs: build
permissions: {}
if: github.event_name != 'pull_request'
# TODO: revert to @main once cmlxc docker support is merged
uses: chatmail/cmlxc/.github/workflows/lxc-test.yml@j4n/docker-support
with:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,13 @@ If you have an existing bare-metal chatmail installation and want to switch to D

## Development / Contributing

To develop or contribute to the Docker setup:

Clone the relay repo and add this repository as a submodule:
Clone the relay repo and add this repository inside, then copy the `.dockerignore` and build:

```bash
git clone https://github.com/chatmail/relay
cd relay
git clone https://github.com/chatmail/docker
cd docker
cp .dockerignore ..
docker compose build
```
34 changes: 33 additions & 1 deletion chatmail_relay.dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# syntax=docker/dockerfile:1
FROM jrei/systemd-debian:12 AS base

# Build systemd-debian:12 base image locally
# Vendoring https://github.com/j8r/dockerfiles/blob/master/systemd/debian/Dockerfile thats behind
# https://hub.docker.com/r/jrei/systemd-debian/tags?name=bookworm
FROM debian:12 AS systemd-base

ARG VERSION=12

ENV LC_ALL=C
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y systemd systemd-sysv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /lib/systemd/system/sysinit.target.wants/ \
&& rm $(ls | grep -v systemd-tmpfiles-setup)

RUN rm -f /lib/systemd/system/multi-user.target.wants/* \
/etc/systemd/system/*.wants/* \
/lib/systemd/system/local-fs.target.wants/* \
/lib/systemd/system/sockets.target.wants/*udev* \
/lib/systemd/system/sockets.target.wants/*initctl* \
/lib/systemd/system/basic.target.wants/* \
/lib/systemd/system/anaconda.target.wants/* \
/lib/systemd/system/plymouth* \
/lib/systemd/system/systemd-update-utmp*

VOLUME [ "/sys/fs/cgroup" ]

# Main chatmail-relay image
FROM systemd-base AS base

ENV LANG=en_US.UTF-8

Expand Down