docker安装gitlab中文版(gitlab-ce:11.3.0-ce.0社区版)

docker安装gitlab中文版(gitlab-ce:11.3.0-ce.0社区版)

1.安装docker:

yum install docker

2.拉取gitlab中文镜像

docker pull beginor/gitlab-ce:11.3.0-ce.0
[root@localhost ~]# docker pull beginor/gitlab-ce:11.3.0-ce.0
Trying to pull repository docker.io/beginor/gitlab-ce ... 
11.3.0-ce.0: Pulling from docker.io/beginor/gitlab-ce
3b37166ec614: Pull complete 
504facff238f: Pull complete 
ebbcacd28e10: Pull complete 
c7fb3351ecad: Pull complete 
2e3debadcbf7: Pull complete 
9a78d52e0193: Pull complete 
adc5958991bb: Pull complete 
4cf7319d76a2: Pull complete 
ee8c14549d8f: Pull complete 
d0b268fdd992: Pull complete 
132a23101b7c: Pull complete 
da031cf5746b: Pull complete 
58c5aa5126cb: Pull complete 
18d2c94da37e: Pull complete 
98f5d4b1d771: Pull complete 
c5e93544ccd8: Pull complete 
57f5be4c3b61: Pull complete 
0e8d1fa50294: Pull complete 
bc47480543f6: Pull complete 
Digest: sha256:dc9aad54048a4f64a4a64659be819ecbc2b26ae5e4fc8d6d462301a972be8de3
Status: Downloaded newer image for docker.io/beginor/gitlab-ce:11.3.0-ce.0
[root@localhost ~]# 

3.创建目录:

将 GitLab 的配置 (etc) 、 日志 (log) 、数据 (data) 放到容器之外, 便于日后升级, 因此准备这三个目录。

mkdir -p /usr/local/gitlab/etc 
mkdir -p /usr/local/gitlab/log 
mkdir -p /usr/local/gitlab/data

4.修改目录权限

chmod 777 /usr/local/gitlab/etc
chmod 777 /usr/local/gitlab/log
chmod 777 /usr/local/gitlab/data

4.运行:

–publish 8443:443:将http:443映射到外部端口8443
–publish 8888:80:将web:80映射到外部端口8888
–publish 8222:22:将ssh:22映射到外部端口8222
–name gitlab 运行容器名
–restart unless-stopped 重启策略
–volume /usr/local/gitlab/etc:/etc/gitlab 挂载目录
–volume /usr/local/gitlab/log:/var/log/gitlab 挂载目录
–volume /usr/local/gitlab/data:/var/opt/gitlab 挂载目录
–privileged=true 使得容器内的root拥有真正的root权限。否则,container内的root只是外部的一个普通用户权限

docker run --detach --publish 8443:443 --publish 8888:80 --publish 8222:22 --name gitlab --restart unless-stopped --volume /usr/local/gitlab/etc:/etc/gitlab --volume /usr/local/gitlab/log:/var/log/gitlab --volume /usr/local/gitlab/data:/var/opt/gitlab --privileged=true beginor/gitlab-ce:11.3.0-ce.0

5.访问:

稍等片刻,初始化完毕,再打开浏览器:ip地址:8888 (http://192.168.0.10:8888/)
docker安装gitlab中文版(gitlab-ce:11.3.0-ce.0社区版)_第1张图片

你可能感兴趣的:(docker,centos,linux,devops,容器)