docker安装gitlab
https://docs.gitlab.com/omnibus/docker/
使用文档:
https://docs.gitlab.com.cn/ce/gitlab-basics/README.html
git使用:
http://blog.jobbole.com/25775/
拉取镜像:
docker pull gitlab/gitlab-ce
运行gitlab
sudo docker run --detach \
--hostname 10.39.10.223 \
--publish 443:443 --publish 80:80 --publish 2222:22 \
--name gitlab \
--restart always \
--volume /data0/gitlab/config:/etc/gitlab \
--volume /data0/gitlab/logs:/var/log/gitlab \
--volume /data0/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
运行成功后,即可通过80访问页面,2222为ssh端口。
配置gitlab服务器的访问地址
修改gitlab的配置文件
vi /data0/gitlab/config/gitlab.rb
配置http协议所使用的访问地址,此处为主机ip地址:
external_url 'http://10.39.10.223'
修改gitlab.rb配置文件之后,重启容器。或者在容器里执行gitlab-ctl reconfigure命令
Command line instructions
Git global setup
git config --global user.name "dataqa"
git config --global user.email "249016681@qq.com"
Create a new repository
git clone git@10.39.10.223:dataqa/te.git
cd te
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
Existing folder
cd existing_folder
git init
git remote add origin git@10.39.3.23:dataqa/te.git
git add .
git commit -m "Initial commit"
git push -u origin master
Existing Git repository
cd existing_repo
git remote add origin git@10.39.3.23:dataqa/te.git
git push -u origin --all
git push -u origin --tags