diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ba25884 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,50 @@ +name: Build + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + id-token: write + packages: write + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/${{ github.repository }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v4 + with: + file: Containerfile + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..0923962 --- /dev/null +++ b/Containerfile @@ -0,0 +1,18 @@ +FROM debian:trixie-slim + +ENV DEBIAN_FRONTEND=noninteractive + +RUN groupadd -g 999 dovecot +RUN useradd -d /var/lib/dovecot -r -s /bin/false -u 999 -g 999 dovecot +RUN useradd -d /var/lib/dovecot -r -s /bin/false -u 999 -g 999 -o dovenull + +RUN apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y --no-install-recommends dovecot-core && \ + rm -rf /etc/dovecot/* /run/* + +VOLUME ["/var/lib/dovecot"] + +USER dovecot +ENTRYPOINT ["/usr/sbin/dovecot", "-F"] +CMD []