Monday, September 18, 2017

Zimbra - Docker Compose

If you are also using "docker compose" for defining and running multi-container Docker applications like me, and if you are also using Zimbra, here is my verison of "docker-compose.yml" to get zimbra running in a docker container.

The "Dockerfile" is from "https://github.com/Zimbra-Community/zimbra-docker", but I made few modifications:

1. Instead of downloading "zimbra-zcs-8.6.0.tar.gz" from "https://files.zimbra.com/downloads/8.6.0_GA/" each time you "up" the container, I recommend you manually download it prior to installation, then just "tar -xzvf" it (zimbra/docker-container/docker/opt/start.sh, line 146-151)

2. "docker-compose.yml" v2 has a "dns" configuration bug, it doesn't update the "/etc/resolv.conf" file, so I manually hacked the "start.sh" (https://github.com/tonylixu/docker-compose/blob/master/examples/zimbra/docker-container/docker/opt/start.sh with the following code:
## Fix /etc/resolv.conf file
echo "Update /etc/resolv.conf file"
echo $'nameserver 127.0.0.1\nnameserver 8.8.8.8' > /etc/resolv.conf
cat /etc/resolv.conf

3. Create a "docker-compose.yml"

Instructions:

  1. Git clone
  2. Go to "zimbra/docker-container/docker" and run "make", this will create "zimbra_docker" image
  3. Go to "zimbra" and do a "docker-compose up"
  4. Go to "https://127.0.0.1" or "https://127.0.0.1:7071" for admin console
  5. Enjoy!


Source code:
"https://github.com/tonylixu/docker-compose/tree/master/examples/zimbra"

No comments: