From 5e1f07ed984adb10ce3998c76f14de3347a004be Mon Sep 17 00:00:00 2001 From: ace Date: Fri, 26 Jan 2024 02:07:41 +0300 Subject: [PATCH] rspamd: improve building scenario --- rspamd/Dockerfile | 11 ++++++++--- rspamd/Makefile | 14 +++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/rspamd/Dockerfile b/rspamd/Dockerfile index 6b516e8..edb3b99 100644 --- a/rspamd/Dockerfile +++ b/rspamd/Dockerfile @@ -1,5 +1,9 @@ FROM almalinux:9 +ARG DOVECOT_VERSION +ARG POSTFIX_VERSION +ARG RSPAMD_VERSION + RUN useradd -m -s /bin/false vmail RUN dnf install -y epel-release dnf-plugins-core \ @@ -8,8 +12,9 @@ RUN dnf install -y epel-release dnf-plugins-core \ && dnf clean all \ && rm -rf /var/cache/yum -RUN dnf install -y postfix-3.5.9 postfix-ldap-3.5.9 postfix-mysql-3.5.9 postfix-pgsql-3.5.9 \ - dovecot-2.3.16 dovecot-pigeonhole-2.3.16 opendkim-2.11.0 opendmarc-1.4.2 \ +RUN dnf install -y postfix-${POSTFIX_VERSION} postfix-ldap-${POSTFIX_VERSION} \ + postfix-mysql-${POSTFIX_VERSION} postfix-pgsql-${POSTFIX_VERSION} \ + dovecot-${DOVECOT_VERSION} dovecot-pigeonhole-${DOVECOT_VERSION} \ cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5 pypolicyd-spf \ && dnf clean all \ && rm -rf /var/cache/yum @@ -17,7 +22,7 @@ RUN dnf install -y postfix-3.5.9 postfix-ldap-3.5.9 postfix-mysql-3.5.9 postfix- RUN update-crypto-policies --set DEFAULT:SHA1 \ && curl https://rspamd.com/rpm-stable/centos-9/rspamd.repo > /etc/yum.repos.d/rspamd.repo \ && rpm --import https://rspamd.com/rpm/gpg.key \ - && dnf install -y rspamd-3.7.5 \ + && dnf install -y rspamd-${RSPAMD_VERSION} \ && dnf clean all \ && rm -rf /var/cache/yum \ && update-crypto-policies --set DEFAULT diff --git a/rspamd/Makefile b/rspamd/Makefile index 5bdbead..55d5fc7 100644 --- a/rspamd/Makefile +++ b/rspamd/Makefile @@ -1,13 +1,21 @@ -VERSION=3.7.5-1 +VERSION=3.8.1 +BUILD=1 IMAGE=rspamd REGISTRY=gitea.geekhome.org/ghp +DOVECOT_VERSION=2.3.16 +POSTFIX_VERSION=3.5.9 +RSPAMD_VERSION=$(VERSION) + .PHONY: build push all build: - docker build -t $(REGISTRY)/$(IMAGE):$(VERSION) . + docker build --build-arg DOVECOT_VERSION=$(DOVECOT_VERSION) \ + --build-arg POSTFIX_VERSION=$(POSTFIX_VERSION) \ + --build-arg RSPAMD_VERSION=$(RSPAMD_VERSION) \ + -t $(REGISTRY)/$(IMAGE):$(VERSION)-$(BUILD) . push: - docker push $(REGISTRY)/$(IMAGE):$(VERSION) + docker push $(REGISTRY)/$(IMAGE):$(VERSION)-$(BUILD) all: build push