1.安裝官方CE鏡像html
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訪問git
http://localhostweb
3.郵件配送docker
sudo docker exec -it gitlab vi /etc/gitlab/gitlab.rbbash
docker restart gitlabmaven
https://docs.gitlab.com/omnibus/settings/smtp.htmltcp
以上學自官網:https://docs.gitlab.com/omnibus/docker/gitlab
4.安卓配置gitlab-runnerrest
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.註冊code
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/