Alpine with AMD64/ARM64, support: SPF, DKIM, DMARC
1.1K
Generate a DKIM private key and the corresponding DNS TXT record for your domain.
Replace example.com with your actual domain name.
docker run --rm -it alpine:3.23 ash -c '
apk add --no-cache opendkim-utils
opendkim-genkey -b 2048 -d example.com -s mail -v
echo "===== PRIVATE KEY ====="
cat mail.private
echo "===== PUBLIC DNS RECORD ====="
cat mail.txt
'
services:
postfix:
image: oxmix/postfix
ports:
- "25:25"
environment:
DOMAIN: example.com
DKIM_TXT: |
mail._domainkey IN TXT "v=DKIM1; k=rsa; p=REPLACE_WITH_PUBLIC_KEY"
DKIM_KEY: |
-----BEGIN PRIVATE KEY-----
REPLACE_WITH_PRIVATE_KEY_CONTENT
-----END PRIVATE KEY-----
restart: unless-stopped
Replace the placeholder values with the generated key contents. Keep the private key formatting and line breaks intact.
Important: The DKIM_KEY format shown above must match the format expected by this image. Verify whether the image expects a PKCS#1 RSA private key (BEGIN RSA PRIVATE KEY) or a PKCS#8 private key (BEGIN PRIVATE KEY) before deploying.
Wait for DNS propagation before testing email delivery.
docker compose up -d
docker compose logs -f postfix
Security: Never publish private key or commit it to a public repository. The private key must remain secret.
Content type
Image
Digest
sha256:af6df3f0b…
Size
9.3 MB
Last updated
7 days ago
docker pull oxmix/postfix