How to configure the Runner container in Docker

How to configure the Runner container in Docker

1. Create a runner container

mk@mk-pc:~/Desktop$ docker run -di --name my-runner --net my-gitlab-net gitlab/gitlab-runner:latest
addc6e08521a6f707494c7a05e63670331c76baaf261282bdd17e2e24268583b

2. Configure runner and gitlab to make an association

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:/# 

insert image description here

3. Write pipeline files

.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"

Running the pipeline

insert image description here

This is the end of this article about docker configuration Runner. For more relevant docker configuration Runner content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed deployment of docker+gitlab+gitlab-runner

<<:  JavaScript implements single linked list process analysis

>>:  MySQL learning database backup detailed explanation

Recommend

Using Docker to create static website applications (multiple ways)

There are many servers that can host static websi...

Axios cancels repeated requests

Table of contents Preface 1. How to cancel a requ...

Solution to forgetting the administrator password of mysql database

1. Enter the command mysqld --skip-grant-tables (...

How to create WeChat games with CocosCreator

Table of contents 1. Download WeChat developer to...

MySQL 5.7.24 installation and configuration method graphic tutorial

MySQL is the most popular relational database man...

JQuery implements hiding and displaying animation effects

This article shares the specific code of JQuery t...

Vue implements a simple calculator

This article example shares the specific code of ...

Interpretation of Vue component registration method

Table of contents Overview 1. Global Registration...

How to avoid data loop conflicts when MySQL is configured with dual masters

I wonder if you have ever thought about this ques...

Several ways to generate unique IDs in JavaScript

Possible solutions 1. Math.random generates rando...

Exploring the use of percentage values ​​in the background-position property

How background-position affects the display of ba...

Detailed explanation of CSS3 Flex elastic layout example code

1. Basic Concepts //Any container can be specifie...

Troubleshooting ideas and solutions for high CPU usage in Linux systems

Preface As Linux operation and maintenance engine...

How to set remote access permissions in MySQL 8.0

The previous article explained how to reset the M...

How to display JSON data in HTML

background: Sometimes we need to display json dat...