我正在尝试让 postfix 在 gitlab/gitlab-ce:9.3.6-ce.0 docker 容器上运行,但它似乎无法启动
我收到以下错误:
postfix start
postfix/postfix-script: starting the Postfix mail system
postfix/postfix-script: fatal: mail system startup failed
我的配置如下:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
inet_interfaces = all
inet_protocols = all
mailbox_size_limit = 0
mydestination = $myhostname, ipayroll.co.nz, ip-10-136-28-218.ap-
southeast-2.compute.internal, localhost.ap-southeast-2.compute.internal, localhost
myhostname = ip-10-136-28-218.ap-southeast-2.compute.internal
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database =
btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
这是图像的操作系统:
NAME="Ubuntu"
VERSION="16.04.2 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.2 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
我认为这是容器的问题,因为我之前在其他容器上安装过 Postfix。但这次我就是搞不清楚。我尝试过多种安装 Postfix 的方法,但这是我常用的方法。
apt-get update && apt-get install postfix
答案1
这里的问题是我使用错误的 shell 运行命令,我使用的是 /bin/bash 而不是 /bin/sh。一旦我尝试通过 dockerfile 执行此操作并通过入口点启动,一切都会顺利进行。