docker配置Runner容器的方法
發(fā)布日期:2021-12-08 04:31 | 文章來(lái)源:CSDN
1.創(chuàng)建runner容器
mk@mk-pc:~/桌面$ docker run -di --name my-runner --net my-gitlab-net gitlab/gitlab-runner:latest addc6e08521a6f707494c7a05e63670331c76baaf261282bdd17e2e24268583b
2.配置runner和gitlab做一個(gè)關(guān)聯(lián)
root@addc6e08521a:/# gitlab-runner register Runtime platform arch=amd64 os=linux pid=262 revision=4b9e985a version=14.4.0 Running in system-mode. Enter the GitLab instance URL (for example, https://gitlab.com/): http://192.168.88.2/ Enter the registration token: mqL7CpxduBkV55pEwo7A Enter a description for the runner: [addc6e08521a]: my first runner Enter tags for the runner (comma-separated): dockercicd Registering runner... succeeded runner=mqL7Cpxd Enter an executor: docker, parallels, ssh, custom, shell, virtualbox, docker+machine, docker-ssh+machine, kubernetes, docker-ssh: docker Enter the default Docker image (for example, ruby:2.6): app Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! root@addc6e08521a:/#
3.編寫(xiě)流水線文件
.gitlab-ci.yml
stages: - build - deploy build: stage: build tags: - build only: - dev script: - echo "mvn clean" - echo "mvn install" deploy: stage: deploy tags: - deploy only: - dev script: - echo "java -jar dxxx"
運(yùn)行流水線
到此這篇關(guān)于docker配置Runner的文章就介紹到這了,更多相關(guān)docker配置Runner內(nèi)容請(qǐng)搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!
版權(quán)聲明:本站文章來(lái)源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來(lái)源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來(lái)源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來(lái),僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
相關(guān)文章