Giter Site home page Giter Site logo

gitlab-runner-compose-podman's Introduction

GitLab Runner Compose with Podman Example

I was in need of a quick example of setting up a local GitLab instance, running on Podman. So here is a quick and dirty docker-compose setup for doing that.

At the end of this brief example you might also want to have a peek at https://docs.gitlab.com/runner/executors/docker.html#use-podman-to-run-docker-commands

IMHO, Let's just say that while Podman is the future:) it still has some ecosystem quirks bugs and issues, some in Podman, or in friends. But, getting there, every day.

Requirements (only tested on Ubuntu 22.04)

  • Podman 4.6.2++ installed and working. This means

    Podman running as a service:

    podman info | grep -A2 'remoteSocket' # should list exists true and the socket

    Alias has been set, bye docker

    alias docker=podman # has been set

    DOCKER_HOST has been exported (sneaky, here is the podman socket)

    export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock or whatever your podman socket is

  • docker-compose /yes you sadly still need this as podman-compose is not up to the task yet. But we are using podman underneath.

Running steps

  1. docker-compose up Note: Before you have configured your first runner there will be some errors here of type "ERROR: Failed to load config stat /etc/gitlab-runner/config.toml:". Just ignore.

    Change root password for gitlabce

  2. podman exec -it gitlab-ce gitlab-rake "gitlab:password:reset[root]"

  3. docker-compose down && docker-compose un

  4. Go to the GitLab UI at 127.0.0.1 or 10.89.0.2 :) and login with root/pw-you-changed-to

  5. Search for admin area in GUI (Search -> Admin)

  6. Add new instance runner under CI (if the ip changes suddenly here after applying, just change it back and enter, it has happened a few times)

  7. You should now see an instruction page for how to register the runner, and a token.

  8. Follow the above steps by exec into the running runner and do i.e run gitlab-runner register. (you will change some values later so dont worry if there are some errors here).

    podman exec -it gitlab-runner /bin/bash gitlab-runner register ...follow steps

  9. Still in the runner container : vi /etc/gitlab-runner/config.toml

  10. Have a look at the runner.example.toml in this project and add what you need: host, privileged and FF_NET.. are needed for podman at least.

  11. docker-compose down && docker-compose, login to ui, check that the runner is online in the admin area

  12. Add a testproject, ci pipes, have fun!!

gitlab-runner-compose-podman's People

Contributors

janderssonse avatar

Stargazers

Johannes Dannelöv avatar

Watchers

 avatar

gitlab-runner-compose-podman's Issues

Clearify expected errors in README

ISSUE

When trying to start up one can see the following errors popping up in the logs;

ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory builds=0 max_builds=1

This is expected if you dont have already configured a runner

POSSIBLE FIX

A note can be added in the README

no container with name or ID "gitlab" found: no such container

ISSUE

Step 2 in README tells users to run

podman exec -it gitlab gitlab-rake "gitlab:password:reset[root]"

but this results in an error since the container name is set to gitlab-ce

POSSIBLE FIX

Change to

podman exec -it gitlab-ce gitlab-rake "gitlab:password:reset[root]"

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.