您的位置:首页 > 运维架构 > Docker

docker搭建gitlab

2018-03-04 22:52 246 查看

docker搭建gitlab

在服务器上直接安装gitlab,会装入Git,Redis ,postgresql,nginx等。如果主机已有redis、nginx等,配置会比较麻烦。而且以后gitlab的备份和迁移都不方便。附主机安装教程:
https://about.gitlab.com/downloads/#centos7
https://mirror.tuna.tsinghua.edu.cn/help/gitlab-ce/12
如果将gitlab进行Docker化部署,所有服务如redis,postgresql等放在一个docker容器里,将配置、数据等文件挂载在宿主机上,备份和迁移时候只要复制docker镜像和挂载的数据目录即可。

运行gitlab容器

#查找镜像
[root@cloud ~]# docker search gitlab

INDEX       NAME                                               DESCRIPTION                                     STARS     OFFICIAL   AUTOMATED
docker.io   docker.io/gitlab/gitlab-ce                         GitLab Community Edition docker image base...   946                  [OK]
docker.io   docker.io/sameersbn/gitlab                         Dockerized gitlab web server                    803                  [OK]
docker.io   docker.io/gitlab/gitlab-runner                                                                     143                  [OK]
docker.io   docker.io/gitlab/gitlab-ee                         GitLab Enterprise Edition docker image bas...   47                   # 拉取镜像
docker pull docker.io/gitlab/gitlab-ce

# 启动镜像(使用桥接网络启动docker)
docker run --detach \
--publish 9443:443 --publish 9080:80 --publish 9022:22 \
--name gitlab \
--restart always \
--volume /app/gitlab/config:/etc/gitlab \
--volume /app/gitlab/logs:/var/log/gitlab \
--volume /app/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce
浏览器打开http://132.97.xxx.xxx:9080 即可访问到gitlab
gitlab初始用户名/密码:
username: root
password: 5iveL!fe
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  docker 搭建