1、安装禅道镜像
手动获取地址为:https://hub.docker.com/r/easysoft/zentao/tags。可根据所需版本拉取对应版本的镜像,默认latest为禅道开源最新版本。
sudo docker pull easysoft/zentao
sudo docker pull easysoft/zentao:latest
sudo docker pull easysoft/zentao:15.7.1
执行结果:
[root@leyouzi ~]# sudo docker pull easysoft/zentao Using default tag: latest latest: Pulling from easysoft/zentao e4ca327ec0e7: Pull complete 76b344453e58: Pull complete 7a2360bde55d: Pull complete 57902f1be313: Pull complete 824ad09c7229: Pull complete c94257dce7d9: Pull complete 8353cede443f: Pull complete 9753fcf1bad4: Pull complete 0efa17d86a60: Pull complete 1ae375f00bc3: Pull complete 87b44190c040: Pull complete 2cf8a12a98d0: Pull complete b7cb001344ca: Pull complete deab9b7848e1: Pull complete d0d38da879a1: Pull complete 0f7ee18302f3: Pull complete b052db5b9893: Pull complete f6170236baf7: Pull complete 764525a4829b: Pull complete Digest: sha256:9dd513ee48d31cde39b00cf327af6d486474c01dafc922d2ca901d1fed69842d Status: Downloaded newer image for easysoft/zentao:latest docker.io/easysoft/zentao:latest [root@leyouzi ~]#
2、创建docker网络驱动
命令格式:sudo docker network create –subnet=[ip范围] [网络驱动名] ip范围:例如172.172.172.0/24的意思ip可以指定范围为172.172.172.1到172.172.172.254; 网络驱动名:创建的网络驱动名,可随意指定;
sudo docker network create --subnet=172.22.40.0/24 zentaonet
3、启动禅道容器:
命令格式:sudo docker run –name [容器名] -p [主机端口]:80 –network=[网络驱动名] –ip [容器IP] –mac-address [mac地址] -v [主机禅道目录]:/www/zentaopms -v [主机mysql目录]:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=[数据库密码] -d easysoft/zentao:[镜像标签] 容器名:启动的容器名字,可随意指定; 主机端口:主机端口为web访问端口; 网络驱动名:刚刚创建的网络驱动名; 容器IP:在网络驱动范围内选择一个作为该容器的固定ip; mac地址:指定固定的mac地址,建议范围为02:42:ac:11:00:00 到 02:42:ac:11:ff:ff; 主机禅道目录:必须指定,方便禅道代码、附件等数据的持久化,非升级情况需指定空目录; 主机mysql目录:必须指定,方便禅道数据持久化,非升级情况需指定空目录; 数据库密码: 容器内置mysql用户名为root,默认密码123456,如果不修改可以不指定该变量,如果想更改密码可以设置 MYSQL_ROOT_PASSWORD变量来更改密码; 镜像标签:禅道版本。 例如:在主机上创建空目录/www/zentaopms和/www/mysqldata,执行如下命令
sudo docker run --name zentao -p 8081:80 --network=zentaonet --ip 172.22.40.101 --mac-address 02:42:ac:11:00:00 -v /www/zentaopms:/www/zentaopms -v /www/mysqldata:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d easysoft/zentao:latest
执行结果:
[root@leyouzi mysql]# sudo docker run --name zentao -p 8081:80 --network=zentaonet --ip 172.22.40.101 --mac-address 02:42:ac:11:00:00 -v /www/zentaopms:/www/zentaopms -v /www/mysqldata:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 -d easysoft/zentao:latest Unable to find image 'easysoft/zentao:latest' locally latest: Pulling from easysoft/zentao e4ca327ec0e7: Already exists 76b344453e58: Already exists 7a2360bde55d: Already exists 57902f1be313: Already exists 824ad09c7229: Already exists c94257dce7d9: Already exists 8353cede443f: Already exists 9753fcf1bad4: Already exists 0efa17d86a60: Already exists 1ae375f00bc3: Already exists 87b44190c040: Already exists 2cf8a12a98d0: Already exists b7cb001344ca: Already exists deab9b7848e1: Already exists d0d38da879a1: Already exists 0f7ee18302f3: Already exists b052db5b9893: Already exists f6170236baf7: Already exists 764525a4829b: Already exists Digest: sha256:9dd513ee48d31cde39b00cf327af6d486474c01dafc922d2ca901d1fed69842d Status: Downloaded newer image for easysoft/zentao:latest 61bb44b6820aee6276487995337f236eeea7a4b63da8cdc04dbd5290d2da7ab8 [root@leyouzi mysql]#
4、页面配置禅道
浏览器直接访问 http://宿主机ip:宿主机映射端口 宿主机ip:172.22.40.101或云服务器的公网IP 映射端口:8081 http://172.22.40.101:8081
5、官网安装教程
官网参考链接:Docker方式部署禅道