Docker 安装 gitlabsteemCreated with Sketch.

in docker •  7 years ago 

启动容器

docker run -d --hostname gitlab.example.com --publish 7443:443 --publish 7480:80 --publish 7422:22 --name gitlab --restart always --volume /opt/gitlab/config:/etc/gitlab --volume /opt/gitlab/logs:/var/log/gitlab --volume /opt/gitlab/data:/var/opt/gitlab docker.io/gitlab/gitlab-ce:latest

查看该容器内部运行的几个组件的版本

docker exec -it gitlab ruby --version
ruby 2.3.5p376 (2017-09-14 revision 59905) [x86_64-linux]

docker exec -it gitlab git --version
git version 2.13.6

docker exec -it gitlab redis-cli --version
redis-cli 3.2.5

docker exec -it gitlab psql --version
psql (PostgreSQL) 9.6.5

我们看到Gitlab使用了4个开源软件或运行环境:ruby、git、redis和postgresql,实际上微服务不推荐这种做法。

修改gitlab的配置文件

docker exec -it gitlab vi /etc/gitlab/gitlab.rb
external_url 'http://192.168.182.15:80'

重启容器生效
docker restart gitlab

登陆

http://192.168.182.15:7480
打开后会自动让你设置root用户的密码。

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!