First Install repository. Update apt package.
$ sudo apt-get update $ sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release2. Add docker’s GPG key.
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg3. Set up stable docker repository.
$ echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install docker engine
Update apt package and install docker engine.$ sudo apt-get update $ sudo apt-get install docker-ce docker-ce-cli containerd.io2. Config docker start on boot.
$ sudo systemctl enable docker.service $ sudo systemctl enable containerd.serviceConfig docker access remote
Open docker.sevice with editor.
$ sudo systemctl edit docker.service2. Place this below code value in docker.service.
[Service] ExecStart= ExecStart=/usr/bin/dockerd -H fd:// -H tcp://127.0.0.1:23753. Save file
4. Reload systemctl configuration.
5. Restart docker.
$ sudo systemctl restart docker.service6. Check docker configuration with ss confirm dockerd listening port.
$ sudo ss -lntp | grep dockerd
Install gitlab runner
1. Download the binary for your system.$ sudo curl -L — output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd642. Give it permission to execute.
$ sudo chmod +x /usr/local/bin/gitlab-runner3. Create a GitLab Runner user.
$ sudo useradd — comment ‘GitLab Runner’ — create-home gitlab-runner — shell /bin/bash4. Install and run as a service.
$ sudo gitlab-runner install — user=gitlab-runner — working-directory=/home/gitlab-runner sudo gitlab-runner start5. Register runner.$ sudo gitlab-runner register --url https://gitlab.com/ --registration-token $REGISTRATION_TOKENConfig gitlab runner
Config /etc/gitlab-runner/config.toml$ sudo nano /etc/gitlab-runner/config.toml2. Add this below line for each runner in [runner.docker]
volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"] network_mode = "host"And thats all folks! try with your own responsibility.
0 comments:
Post a Comment