Code Monkey home page Code Monkey logo

gitlab-ce-gitlab-runner-docker's Introduction

Setup Gitlab CE and Gitlab Runner with docker

Gitalb Server CE

We have 2 solutions to install gitlab-ce

  web:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: '54.169.192.203'
    container_name: gitlab-ce
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://54.169.192.203'
    ports:
      - 80:80
      - 443:443
    volumes:
      - '/mnt/efs/fs1/gitlab/config:/etc/gitlab'
      - '/mnt/efs/fs1/gitlab/logs:/var/log/gitlab'
      - '/mnt/efs/fs1/gitlab/data:/var/opt/gitlab'
    networks:
      - gitlab
networks:
  gitlab:
    name: gitlab-network

After we install or deploy gitlab ce we need to configuration external_url.

# [Optional for docker container]
docker exec -it --user=root gitlab-ce sh

# Update gitlab ce config for external_url
sudo vim /etc/gitlab/gitlab.rb

# Reload gitlab ce configuration
sudo gitlab-ctl reconfigure

# Get default root password
sudo grep 'Password:' /etc/gitlab/initial_root_password

# Reset root password
sudo gitlab-rake 'gitlab:password:reset[root]'

Gitlab Runner

We have 2 solutions to install gitlab runner

  • Native install on Linux
# Based on AMI 2023
# Add the official GitLab repository
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | sudo bash

# Install the latest version of GitLab Runner
sudo yum install gitlab-runner
  • Docker container
gitlab-runner:
    image: gitlab/gitlab-runner:alpine
    container_name: gitlab-runner
    restart: always
    depends_on:
      - web
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - '/mnt/efs/fs1/gitlab/gitlab-runner:/etc/gitlab-runner'
    networks:
      - gitlab
networks:
  gitlab:
    name: gitlab-network

Next step gitlab runner register

# Login gitlab ce portal with root /admin
# Goto CI/CD > Runners > New instance runner
# Choose Linux and create

# [Optional for docker container]
docker exec -it --user=root gitlab-runner sh

sudo gitlab-runner register  --url http://54.169.192.203  --token glrt-Xzynx3ozBzMUQdvxhebv

#OR

sudo gitlab-runner register
  --non-interactive \
  --url "http://54.169.192.203"
  --token "glrt-Xzynx3ozBzMUQdvxhebv"
  --executor "docker" \
  --docker-image alpine:latest \
  --description "docker-runner" \
  --maintenance-note "Free-form maintainer notes about this runner" \
  --tag-list "docker,aws" \
  --run-untagged="true" \
  --locked="false" \
  --access-level="not_protected" \
  --docker-privileged

References

gitlab-ce-gitlab-runner-docker's People

Contributors

kergrit avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.