我已经使用docker镜像安装了gerrit。 我可以使用以下命令运行此Gerrit设置:
docker run -ti -p 8080:8080 -p 29418:29418 gerritcodereview/gerrit
它一直在运行。
我可以使用localhost:8080
说,我创建了3个用户user1,user2,user3。
如果偶然的运行中的docker进程被杀死或退出,而我再次运行该命令,则新出现安装程序。所有旧数据或用户都将丢失。
即使系统关闭或重新启动,也不应丢失数据或不能删除用户。
答案 0 :(得分:1)
您需要通过卷挂装启动容器:
-v /path/localhost/:/var/gerrit/git
-v /path2/localhost/:/var/gerrit/db
-v /path3/localhost/:/var/gerrit/index
-v /path4/localhost/:/var/gerrit/cache
您可以在docs以下示例中看到
:version: '3'
services:
gerrit:
image: gerritcodereview/gerrit
volumes:
- git-volume:/var/gerrit/git
- db-volume:/var/gerrit/db
- index-volume:/var/gerrit/index
- cache-volume:/var/gerrit/cache
ports:
- "29418:29418"
- "8080:8080"
volumes:
git-volume:
db-volume:
index-volume:
cache-volume:
由您决定使用named
还是mount
volumes