Docker快速部署gitlab应用实战

Gitlab是一个用于仓库管理系统开源项目,使用Git作为代码管理工具,并在此基础上搭建的web服务,可通过web界面进行访问公开或者私人项目,拥有类似于GIthub类似的功能,能够浏览源代码,可管理团队对仓库的访问

curl -o  /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y yum-utils device-mapper-persistent-data lvm2
yum clean all
yum install -y yum-utils device-mapper-persistent-data lvm2
echo "13.224.2.103 download.docker.com" >>/etc/hosts
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce
systemctl start docker
systemctl enable docker

[root@localhost ~]# cat >/etc/docker/daemon.json<<EOF
> {
> "registry-mirrors":["https://fxde.mirror.aliyuncs.com"]
> } 
> EOF
[root@localhost ~]# cat /etc/docker/daemon.json 
{
"registry-mirrors":["https://fxde.mirror.aliyuncs.com"]
} 

 #docker pull gitlab/gitlab-ce 

# mkdir -p /home/gitlab/{config,logs,data}
#  docker run -itd --name gitlab -p 443:443 -p 80:80 -p 222:22 --restart=always -v /home/gitlab/config/:/etc/gitlab  -v /home/gitlab/logs/:/var/log/gitlab -v /home/gitlab/data/:/var/opt/gitlab docker.io/gitlab/gitlab-ce
64010f0f82d8f2dda8356920975fcb7dfda24f012fa693b3728137fb5b37ec1b
# docker ps -a

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
390495410c43 docker.io/gitlab/gitlab-ce "/assets/wrapper" 6 hours ago Up 2 hours (healthy) 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:222->22/tcp gitlab

# egrep -v "#|^$" /home/gitlab/config/gitlab.rb  #修改宿主机gitlab配置文件

external_url 'http://192.168.60.100'
gitlab_rails['gitlab_ssh_host'] = '192.168.60.100'
gitlab_rails['gitlab_shell_ssh_port'] = 222

 

#docker restart gitlab

浏览器访问:http://192.168.60.100/

 

【创建一个新项目】

 

#git clone http://192.168.60.100/root/gitlab-test.git

Cloning into 'gitlab-test'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.

 

#cd gitlab-test  #cd切换到需要clone下来的目录

#git add .

#git commit -m "Add relay files"

Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 120 insertions(+)
 create mode 100755 InfluxDB_Relay.md

 

#git push origin master

Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 12 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 2.34 KiB | 2.34 MiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To http://192.168.60.100/root/gitlab-test.git
   26970f7..f75195b  master -> master

 

posted @ 2019-06-03 15:47  Mr&Yu  阅读(708)  评论(0编辑  收藏  举报