Deploy Zimbra Collaboration using docker: Difference between revisions

No edit summary
mNo edit summary
 
Line 3: Line 3:
<div class="col-md-12 ibox-content">
<div class="col-md-12 ibox-content">
=Deploy Zimbra Collaboration Server using Docker=
=Deploy Zimbra Collaboration Server using Docker=
{{KB|{{Unsupported}}|{{ZCS 8.6}}||}}
{{KB|{{Unsupported}}|{{ZCS 8.7}}||}}


[[File:Zimbra-docker-en.png|800px]]
[[File:Zimbra-docker-en.png|800px]]
Line 26: Line 26:


===Installing Docker===
===Installing Docker===
First you need to install Docker on the server that you would like to use as a host for the docker containers. For example, here the instructions to install docker in Ubuntu 14.04:
First you need to install Docker on the server that you would like to use as a host for the docker containers.  If you want to install Docker, please follow the next guide - [https://docs.docker.com/engine/installation/ https://docs.docker.com/engine/installation/]
  wget -qO- https://get.docker.com/ | sh
 
If you want to install Docker in a different platform, please follow the next guide - [https://docs.docker.com/installation/#installation https://docs.docker.com/installation/#installation]


One of the advantages of using docker is that the host OS does not matter, the containers will work on any platform.
One of the advantages of using docker is that the host OS does not matter, the containers will work on any platform.


===Creating the Zimbra Image===
=== Downloading the image===
The content of the Dockerfile and the start.sh is based on the next Script -  [[Install_Zimbra_Collaboration_and_a_DNS_Server_with_Script|ZimbraEasyInstall]]. The Dockerfile creates a Ubuntu Server 14.04 image and install on it wget, then when the container is launched, automatically starts with the '''start.sh''' script:
The first step is to pull this image into your docker environment, for that just run the next:
====Using git====
  docker pull jorgedlcruz/zimbra
Download from github, you will need git installed on your OS
git clone https://github.com/Zimbra-Community/zimbra-docker.git
 
=====Using wget=====
For those who want to use wget, follow the next instructions to download the Zimbra-docker package. You might need '''wget''' and '''unzip''' installed on your OS
wget https://github.com/Zimbra-Community/zimbra-docker/archive/master.zip
unzip master.zip
 
====Build the image using the Dockerfile====
The Makefile in the docker/ directory provides you with a convenient way to build your docker image. You might need '''make''' on your OS. Just run
cd zimbra-docker/docker
sudo make
 
The default image name is zimbra_docker. You can specify a different image name by setting the Image variable:
  cd zimbra-docker/docker
sudo IMAGE=your_image_name make
 
You will see the next Steps:
<pre>docker build --rm -t zimbra_docker .
Sending build context to Docker daemon 15.87 kB
Step 1 : FROM ubuntu:14.04
---> 97434d46f197
Step 2 : MAINTAINER Jorge de la Cruz <jorgedlcruz@gmail.com>
---> Using cache
---> 10ba4509fbac
Step 3 : RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install  wget  bind9  bind9utils  bind9-doc  dnsutils  libidn11  libpcre3  libgmp10  libexpat1  libstdc++6  libperl5.18  libaio1  netcat-openbsd  pax  resolvconf  sqlite3  sudo  sysstat  unzip
---> Using cache
---> 8ddf2b3f5152
Step 4 : VOLUME /opt/zimbra
---> Using cache
---> a2a11a097507
Step 5 : EXPOSE 22 25 465 587 110 143 993 995 80 443 8080 8443 7071
---> Using cache
---> 0f8448cce51f
Step 6 : COPY opt /opt/
---> Using cache
---> c849df7c2a64
Step 7 : COPY etc /etc/
---> Using cache
---> 89b1ac2ee6c0
Step 8 : CMD /bin/bash /opt/start.sh
---> Using cache
---> e7eae07a0dfa
Successfully built e7eae07a0dfa</pre>
 
===Deploy the Docker container===
Now to deploy the container based on the previous image. As well as publish the Zimbra Collaboration ports, the hostname and the proper DNS, as you want to use bind as a local DNS nameserver within the container, also we will send the password that we want to our Zimbra Server like admin password, mailbox, LDAP, etc.:
'''Syntax:'''
docker run -p PORTS -h HOSTNAME.DOMAIN --dns DNSSERVER -i -t -e PASSWORD=YOURPASSWORD NAMEOFDOCKERIMAGE
'''Example:'''
docker run -p 25:25 -p 80:80 -p 456:456 -p 587:587 -p 110:110 -p 143:143 -p 993:993 -p 995:995 -p 443:443 -p 8080:8080 -p 8443:8443 -p 7071:7071 -p 9071:9071 -h zimbra86-docker.zimbra.io --dns 127.0.0.1 --dns 8.8.8.8 -i -t -e PASSWORD=Zimbra2015 zimbra_docker
 
This will create the container in few seconds, and run automatically the start.sh:
* Install a DNS Server based in bind9 and the dnsutils package
* Configure all the DNS Server to resolve automatically internal the MX and the hostname that we define while launch the container.
* Install the OS dependencies for Zimbra Collaboration 8.6
* Create 2 files to automate the Zimbra Collaboration installation, the keystrokes and the config.defaults.
* Launch the installation of Zimbra based only in the .install.sh -s
* Inject the config.defaults file with all the parameters that is autoconfigured with the Hostname, domain, IP, and password that you define before.


The script takes a few minutes, dependent on the your Internet Speed, and resources.
=== Creating Zimbra Container ===
Now that we have an image called jorgedlcruz/zimbra, we can do a docker run with some special parameters, like this:
docker run -p 25:25 -p 80:80 -p 465:465 -p 587:587 -p 110:110 -p 143:143 -p 993:993 -p 995:995 -p 443:443 -p 8080:8080 -p 8443:8443 -p 7071:7071 -p 9071:9071 -h zimbra-docker.zimbra.io --dns 127.0.0.1 --dns 8.8.8.8 -i -t -e PASSWORD=Zimbra2017 jorgedlcruz/zimbra


===Access to the Web Client and Admin Console===
As you can see we tell the container the ports we want to expose, and on which port, we also specify the container hostname, the password foir the Zimbra Administrator Account, and the image to use.
The Script will take care of everything and after a few minutes you can go to the IP address of your server and use the following URLs:


That's it! You can visit now the IP of your Docker Machine using HTTPS, or try the Admin Console with HTTPS and port 7071.
* Web Client - https://YOURIP
* Web Client - https://YOURIP
* Admin Console - https://YOURIP:7071
* Admin Console - https://YOURIP:7071
=== Contribute to the Project===
If you like to contribute to the project, you are free to do so, just fork the next repo and submit your changes. - [https://github.com/jorgedlcruz/zimbra-docker https://github.com/jorgedlcruz/zimbra-docker]


==Additional Content==
==Additional Content==
* Go to the [https://github.com/Zimbra-Community/zimbra-docker Github project] and give your valuable feedback.
* Go to the [https://github.com/jorgedlcruz/zimbra-docker Github project] and give your valuable feedback.


{{Article Footer|Zimbra Collaboration 8.6, 8.5|05/21/2015}}
{{Article Footer|Zimbra Collaboration 8.7|05/21/2015}}

Latest revision as of 22:39, 31 October 2017

Deploy Zimbra Collaboration Server using Docker

   KB 21981        Last updated on 2017-10-31  




0.00
(0 votes)

Zimbra-docker-en.png

Purpose

Install Zimbra Collaboration Server and DNS Server with a Script, in a Single-Server, using Docker.

Resolution

Before you start

This guide is not officially supported by Zimbra, as docker is not in the Operating System, or Virtualization Supported platforms in the System Requirements.

This guide is intended for testing platforms, development, etc.

What is Docker

From the official docker website - Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications. Consisting of a Docker Engine, a portable, lightweight runtime and packaging tool, and Docker Hub, a cloud service for sharing applications and automating workflows, Docker enables apps to be quickly assembled from components and eliminates the friction between development, QA, and production environments. As a result, IT can ship faster and run the same app, unchanged, on laptops, data center VMs, and any cloud.

Advantages of using Docker and the ZimbraEasyInstall Script

  • Time saving
  • Fully automated
  • Easy to use
  • Great for a quick Zimbra Preview

Installing Docker

First you need to install Docker on the server that you would like to use as a host for the docker containers. If you want to install Docker, please follow the next guide - https://docs.docker.com/engine/installation/

One of the advantages of using docker is that the host OS does not matter, the containers will work on any platform.

Downloading the image

The first step is to pull this image into your docker environment, for that just run the next:

docker pull jorgedlcruz/zimbra

Creating Zimbra Container

Now that we have an image called jorgedlcruz/zimbra, we can do a docker run with some special parameters, like this:

docker run -p 25:25 -p 80:80 -p 465:465 -p 587:587 -p 110:110 -p 143:143 -p 993:993 -p 995:995 -p 443:443 -p 8080:8080 -p 8443:8443 -p 7071:7071 -p 9071:9071 -h zimbra-docker.zimbra.io --dns 127.0.0.1 --dns 8.8.8.8 -i -t -e PASSWORD=Zimbra2017 jorgedlcruz/zimbra

As you can see we tell the container the ports we want to expose, and on which port, we also specify the container hostname, the password foir the Zimbra Administrator Account, and the image to use.

That's it! You can visit now the IP of your Docker Machine using HTTPS, or try the Admin Console with HTTPS and port 7071.

Contribute to the Project

If you like to contribute to the project, you are free to do so, just fork the next repo and submit your changes. - https://github.com/jorgedlcruz/zimbra-docker

Additional Content

Verified Against: Zimbra Collaboration 8.7 Date Created: 05/21/2015
Article ID: https://wiki.zimbra.com/index.php?title=Deploy_Zimbra_Collaboration_using_docker Date Modified: 2017-10-31



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Jump to: navigation, search