Dockerでpostfixいれて、mailtrapでメールを受けたいとき、
mailtrap曰く/etc/postfix/sasl_passwdを書かなきゃいけないんですが
そのとおりにやってると
postmap /etc/postfix/sasl_passwd > [21/25] RUN postmap /etc/postfix/sasl_passwd:
#26 0.399 postmap: fatal: parameter inet_interfaces: no local interface found for ::1
とだめだよって・・
ぐぐるとipv6が使えないの/etc/hostsにあるから・・ということらしいので
じゃあその記述を抜いた/etc/hostsをDockerfileでCOPYしようとしたら
今度は
=> ERROR [20/25] RUN grep -v '::1' /etc/hosts > /etc/hosts 0.3s
------
> [20/25] RUN grep -v '::1' /etc/hosts > /etc/hosts:
#24 0.292 /bin/sh: /etc/hosts: Read-only file system
とhostsファイルをイジんじゃねぇとのこと・・
\(^o^)/
ipv6使うつもりないからなぁ・・と見てたら
/etc/postfix/main.cf
# Enable IPv4, and IPv6 if supported
inet_protocols = ALL
という記述を見つけたので
/etc/postfix/main.cf
# Enable IPv4, and IPv6 if supported
inet_protocols = ipv4
としたらpostmap /etc/postfix/sasl_passwdは無事通りました!