轉載請註明出處 http://www.paraller.com
原文排版地址www.paraller.com/2016/05/22/gitlab-runner-maven卡死的狀況/git
項目中遇到的狀況,gitlab-docker runner在構建項目的時候,
總會在download jar包或者pom文件的時候掛起,每次都是在不一樣的下載文件中卡住docker
一、宿主機 install maven2 ,cd /root && vim settings.xml;配置鏡像服務器和倉庫地址ubuntu
二、瀏覽docker-compose.yml ;調整配置 /root/.m2vim
grdocker: image: gitlab/gitlab-runner:latest restart: always volumes: - /root/docker-data/gitlab-runner/docker/config:/etc/gitlab-runner - /var/run/docker.sock:/var/run/docker.sock - /data/git/aliyun/gitlab/hosts:/etc/hosts - /root/.m2:/root/.m2 - /usr/bin/docker:/usr/bin/docker
三、vim /data/docker-data/gitlab-runner/docker/config/config.toml ; 添加volumes緩存
concurrent = 2 [[runners]] name = "docker" url = "http://gitlab.umiit.cn/ci" token = "65331a98de9d6780c9f3403f14b9c6" tls-ca-file = "" executor = "docker" [runners.docker] image = "ubuntu:14.04" privileged = false volumes = ["/cache","/root/.m2:/root/.m2","/var/run/docker.sock:/var/run/docker.sock"]
runner 在構建的時候不在卡死,jar包在很短的時間內下載或緩存定位完畢;服務器
(docker runner cache maven repository)[https://gitlab.com/gitlab-org...]網絡