How to define domainname in a docker run command?

3

I want to create a mail server container with docker. I tried with docker-compose.yml file and this has a parameter named "domainname" . But without docker-compose, using docker run ... I don't know which is the domainname parameter.

Docker-compose.yml:

  mail:
  image: tvial/docker-mailserver
  hostname: mail
  domainname: deploymentbox.com
  ports:
  - "25:25"
  - "143:143"
  - "587:587"
  - "993:993"
  volumes:
  - ./spamassassin:/tmp/spamassassin/
  - ./postfix:/tmp/postfix/

Thanks

canonale

Posted 2015-08-25T19:01:23.683

Reputation: 41

I found one answer at this question Docker issues. Join hostname and domainname in --hostname parameter

– canonale – 2015-08-26T17:34:24.730

Answers

1

I found one answer at this question Docker issues. Join hostname and domainname in --hostname parameter. For exampe:

docker run -d  --hostname mail.deploymentbox.com \
 -p 25:25   -p 143:143   -p 587:587   -p 993:993 \
 -v $PWD/spamassassin:/tmp/spamassassin/   \
 -v $PWD/postfix:/tmp/postfix/ tvial/docker-mailserver 

I try in my server and run.

canonale

Posted 2015-08-25T19:01:23.683

Reputation: 41

3Unfortunately this no longer seem to be the case starting from Docker 1.11+ - using dots in the hostname will not populate the "domainname" property anymore. – Joe – 2016-04-14T14:16:25.973