LoginSignup
0
2

More than 5 years have passed since last update.

Dockerコンテナ内でsendmailを使用する際のhostsの設定

Last updated at Posted at 2017-12-06

目標

コンテナ内の/etc/hostsに設定を追加してもコンテナ再起動時にリセットされてしまうので何とかしたい。

追加する設定例

127.0.0.1 localhost ドメイン ホスト名

domainnameが未設定の場合はlocalhost.localdomain

対応方法

コンテナ作成時に設定を追加してしまえば良い
runコマンドに以下のオプションを追加する

--hostname ホスト名 --add-host "localhost ドメイン ホスト名":127.0.0.1

参考

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2