diff --git a/.gitignore b/.gitignore index d9583a5..b2d1cd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -opt/zimbra-install/zcs-9.0.0_OSE_RHEL8_latest-zextras.tgz +zimbra_all/opt/zimbra-install/zcs-9.0.0_OSE_RHEL8_latest-zextras.tgz diff --git a/CHANGELOG b/CHANGELOG index 7e95bde..7865960 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,11 @@ ### Zimra-docker ChangeLog -##### v0.1/v0.2 - the initial version: -+ Build a Docker image -+ Run a new Zimbra docker container +##### v0.4 ++ Move zimbra_all to subfolder for the next (multi-server) images ##### v0.3 + Add docker-compose capacibility (thanks to Vo Trung Huy aka. [huyrevison2010](https://github.com/huyrevison2010)) + +##### v0.1/v0.2 - the initial version: ++ Build a Docker image ++ Run a new Zimbra docker container diff --git a/README.md b/README.md index 775297f..b8376d9 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,8 @@ # zimbra-docker The project to build a Zimbra 9 (built by Zextras) Docker image based on Rocky Linux 8. -Check out the built image on Docker Hub: https://hub.docker.com/r/iwayvietnam/zimbra_all +Check out the prebuilt image on Docker Hub: https://hub.docker.com/r/iwayvietnam/zimbra_all -### How to build a new Docker image -##### Firstly, of course, install Docker and setup to manage Docker as a non-root user -See: https://docs.docker.com/engine/install/ - -##### Pull the latest Rocky Linux based docker image -```bash -$ docker pull rockylinux/rockylinux -``` -##### Checkout this git repo -```bash -* $ git clone https://github.com/iwayvietnam/zimbra-docker.git && cd zimbra-docker -``` -##### Download the latest Zimbra 9 (built by Zextras) -```bash -$ wget -O opt/zimbra-install/zcs-9.0.0_OSE_RHEL8_latest-zextras.tgz \ -https://download.zextras.com/zcs-9.0.0_OSE_RHEL8_latest-zextras.tgz -``` -##### Build Zimbra a new docker image -```bash -$ docker build --rm -t zimbra_all . -``` ### How to start a new Zimbra container from prebuilt Docker image ##### Create a new Docker network dedicated for Zimbra ```bash @@ -55,25 +34,6 @@ $ docker run --name zimbra-iwaytest2 -it \ -e PASSWORD=Zimbra2021 iwayvietnam/zimbra_all ``` (and WAIT...) -### How to start with Docker compose -##### Require : Install docker-compose for your server -##### Create storage for docker-compose -```bash -$ cd docker-compose && mkdir zimbra-storage -``` -##### Run docker-compose -```bash -$ docker-compose up -d -``` -##### Command check status -```bash -$ docker-compose status -``` -##### Command check logs -```bash -$ docker-compose logs -f -``` -(and WAIT...) ### LICENSE This work is released under GNU General Public License v3 or above. diff --git a/docker-compose/README b/docker-compose/README new file mode 100644 index 0000000..b1f9a1b --- /dev/null +++ b/docker-compose/README @@ -0,0 +1,19 @@ +### How to start with Docker compose +##### Require : Install docker-compose for your server +##### Create storage for docker-compose +```bash +$ cd docker-compose && mkdir zimbra-storage +``` +##### Run docker-compose +```bash +$ docker-compose up -d +``` +##### Command check status +```bash +$ docker-compose status +``` +##### Command check logs +```bash +$ docker-compose logs -f +``` +(and WAIT...) diff --git a/zimbra_all/Dockerfile b/zimbra_all/Dockerfile new file mode 100644 index 0000000..f83a954 --- /dev/null +++ b/zimbra_all/Dockerfile @@ -0,0 +1,44 @@ +# +# Copyright (C) 2021 iWayVietnam +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +################################################################# +# Dockerfile to build Zimbra 9 (built by Zextras) container images +# Based on Rocky Linux 8 +################################################################# +FROM rockylinux/rockylinux +MAINTAINER Truong Anh Tuan + +RUN yum -y update && yum -y install \ + perl \ + glibc-langpack-en \ + net-tools \ + openssh-clients \ + bind-utils \ + rsyslog \ + wget + +RUN ln -s -f /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime + +ENV LANGUAGE=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +VOLUME ["/opt/zimbra"] + +EXPOSE 25 80 465 587 110 143 993 995 443 3443 9071 + +COPY opt /opt/ + +CMD ["/bin/bash", "/opt/build.sh", "-d"] diff --git a/zimbra_all/README b/zimbra_all/README new file mode 100644 index 0000000..8cc152c --- /dev/null +++ b/zimbra_all/README @@ -0,0 +1,21 @@ +### How to build a new Docker image +##### Firstly, of course, install Docker and setup to manage Docker as a non-root user +See: https://docs.docker.com/engine/install/ + +##### Pull the latest Rocky Linux based docker image +```bash +$ docker pull rockylinux/rockylinux +``` +##### Checkout this git repo +```bash +* $ git clone https://github.com/iwayvietnam/zimbra-docker.git && cd zimbra-docker/zimbra_all +``` +##### Download the latest Zimbra 9 (built by Zextras) +```bash +$ wget -O opt/zimbra-install/zcs-9.0.0_OSE_RHEL8_latest-zextras.tgz \ +https://download.zextras.com/zcs-9.0.0_OSE_RHEL8_latest-zextras.tgz +``` +##### Build Zimbra a new docker image +```bash +$ docker build --rm -t iwayvietnam/zimbra_all . +``` diff --git a/opt/build.sh b/zimbra_all/opt/build.sh similarity index 97% rename from opt/build.sh rename to zimbra_all/opt/build.sh index 4a435a2..bba4b19 100755 --- a/opt/build.sh +++ b/zimbra_all/opt/build.sh @@ -152,7 +152,9 @@ echo "Installing Zimbra Collaboration injecting the configuration" /opt/zimbra/libexec/zmsetup.pl -c /opt/zimbra-install/installParameters su - zimbra -c 'zmcontrol restart' -echo "You can access now to your Zimbra Collaboration Server" +echo "You can access now to your Zimbra Collaboration Server $HOSTNAME.$DOMAIN" + +rm -Rf /opt/zimbra-install if [[ $1 == "-d" ]]; then while true; do sleep 1000; done diff --git a/opt/zimbra-install/install-autoKeys b/zimbra_all/opt/zimbra-install/install-autoKeys similarity index 100% rename from opt/zimbra-install/install-autoKeys rename to zimbra_all/opt/zimbra-install/install-autoKeys