1.安装官方CE镜像
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 443:443 --publish 80:80 --publish 22:22 \
--name gitlab \
--restart always \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/logs:/var/log/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
2.web访问
http://localhost
3.邮件配送
sudo docker exec -it gitlab vi /etc/gitlab/gitlab.rb
docker restart gitlab
https://docs.gitlab.com/omnibus/settings/smtp.html
以上学自官网:https://docs.gitlab.com/omnibus/docker/
4.安卓配置gitlab-runner
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
5.注册
docker exec -it gitlab-runner gitlab-runner register
#runner列表
docker exec -it gitlab-runner gitlab-runner list
#runner验证
docker exec -it gitlab-runner gitlab-runner verify
#使用本地maven
vi /srv/gitlab-runner/config/config.toml
[runners.docker]
volumes = ["/cache","/root/.m2:/root/.m2/repository"]
pull_policy = "if-not-present"
https://docs.gitlab.com.cn/runner/commands/README.html
iptables -I INPUT -p tcp --dport 80 -j ACCEPT,#一定要开启80端口
gitlab-runner构建上传image时权限失败解决办法
sudo usermod -a -G docker gitlab-runner
https://www.gitlab.com.cn/