目录
1. 官方镜像
2. 环境要求
3. 安装
4. 初始登录
5. 常见问题
5.1. docker: Error response from daemon: cannot start a stopped process: unknown.
1. 官方镜像
2. 环境要求
3. 安装
Before setting everything else, configure a new environment variable $GITLAB_HOME pointing to the directory where the configuration, logs, and data files will reside. Ensure that the directory exists and appropriate permission have been granted.
export GITLAB_HOME=/srv/gitlab
docker search gitlab
docker pull gitlab/gitlab-ee
sudo docker run --detach \
--publish 443:443 \
--publish 80:80 \
--publish 2222:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
--volume $GITLAB_HOME/logs:/var/log/gitlab \
--volume $GITLAB_HOME/data:/var/opt/gitlab \
gitlab/gitlab-ee:latest
注:由于 CentOS 中的 SSH 已经占用了 22 端口,所以这里用 2222 代替。
经过以上步骤后,当你 clone 项目时,会发现地址不对,此时需要修改 gitlab 配置文件。
进入容器:
docker exec -it gitlab /bin/bash
编辑配置文件:
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
修改 host 为具体 ip 地址:
保存修改并重启服务:
gitlab-ctl restart
再来看一下 clone 项目时的地址:
4. 初始登录
sudo docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
5. 常见问题
5.1. docker: Error response from daemon: cannot start a stopped process: unknown.
安装:
yum install -y libseccomp-devel
参考:
Install GitLab using Docker Engine: https://docs.gitlab.com/ee/install/docker.html#install-gitlab-using-docker-engine GitLab官方镜像: https://hub.docker.com/u/gitlab