How to manage Zen Tao based on docker? Today I will take a look with my friends.
Run
First of all, in order to facilitate later maintenance, we prepared the following docekr container instance running script for everyone.
docker run -d --restart always -p 80:80 -p 3306:3306 \
-e ADMINER_USER="root" -e ADMINER_PASSWD="password" \
-e BIND_ADDRESS="false" \
-v /data/docker/zentao/:/opt/zbox/ \
--add-host smtp.exmail.qq.com:163.177.90.125 \
--name zentao-server \
idoop/zentao:latest
In the above startup script, we mount the directory /opt/zbox/
in the container named zentao to the /data/zentao/
directory of the host machine.Therefore, we need to create the directory in advance on the host machine.Create the directory with the following command.
mkdir -p /data/zentao/
In the above zentao docker container running script, we used some parameters, so what are these parameters used for, and where did they come from? I guess many friends may be a little confused. These parameters are found from the official link of zentao on docker hub, click here to enter the official website. The following picture was taken by Zentao official on the docker hub. We can see what parameters are there and what their role is.
After completing the above work, execute the above docker container running script to start a container instance named zentao.
Firewall
The zentao instance is running, but we still cannot connect from other hosts. In order to connect to the service corresponding to the container from other hosts, we need to add the corresponding port number involved in the container to the white list through the firewall command.We use the following command to add ports to the firewall whitelist.
[root@xtwj77 ~]# firewall-cmd --permanent --zone=public --add-port=80/tcp
success
[root@xtwj77 ~]# firewall-cmd --reload
success
[root@xtwj77 ~]# firewall-cmd --zone=public --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: dhcpv6-client ssh
ports: 80/tcp 3306/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
[root@xtwj77 ~]# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e64eb3d05f07 idoop/zentao:latest "docker-entrypoint" 7 minutes ago Up 7 minutes (healthy) 0.0.0.0:80->80/tcp, 0.0.0.0:3306->3306/tcp zentao-server
[root@xtwj77 ~]
After completing the above work, we can visit the zentao service normally.
Open the browser and enter the URL http: // 192.168.3.77 / zentao /
in the address bar of the browser. We can enter the login page of the Zen Tao system. For the first login, the user uses admin and the password uses 123456. , The password needs to be changed after successful login.
Maintain
In actual work, we always need to maintain the zentao system, and backup and recovery is an important part of the maintenance work. Next, I will introduce you to the backup and recovery of zentao in the docker environment, as shown in the following figure.
For ZenTao, we can use “Background”-> “Data”-> “Backup” to generate the state data of the system before migration, and transfer the relevant data to the corresponding location on the target host through file transfer Select “Restore” to complete the system migration.
References