Skip to content

An example of how you can run a local GitLab, Gitea Git Provider. Handy for development.

License

Notifications You must be signed in to change notification settings

itiquette/local-git-provider-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running a Local Git Provider Example (with Podman - Compose)

Introduction

This project provides an compose example of how to run Git Providers with Podman and Docker Compose. It currently has:

  • Local GitLab

  • Local Gitea

Prerequisites

  • Ubuntu 24.04 (might work with other versions, only tested on 24.04)

  • Podman 4.9.3 or later installed and working

  • Podman running as a rootless service

  • docker aliased to podman

  • DOCKER_HOST exported to the Podman socket

  • Podman network backend set to netavark

  • Docker Compose v2.28.1 or later

ℹ️

Older versions than those mentioned above are not tested, but could work.

Verifying Prerequisites

Check Podman version:
podman info  # see version
Verify Podman is running as a rootless service:
podman info | grep -A2 'remoteSocket' # should list exists true and the socket
Confirm docker is aliased to podman:
alias docker=podman
Verify DOCKER_HOST is exported:
export DOCKER_HOST=unix:///run/user/1000/podman/podman.sock # or whatever your podman socket is, see podman info
Check Podman network backend:
podman info | grep -A2 'backend' # only tested with netavark
Verify Docker Compose version:
docker compose version # v2 and v2.28.1++

GitLab Setup

Running GitLab

1. Run compose:
podman compose pull && podman compose --profile gitlab up
ℹ️

Before configuring your first runner, you may see errors like "ERROR: Failed to load config stat /etc/gitlab-runner/config.toml:". These can be ignored for now.

You might also need to give rootless Podman port rights:

sudo sysctl net.ipv4.ip_unprivileged_port_start=80
2. Change root password for GitLab CE:
podman exec -it gitlab-ce gitlab-rake "gitlab:password:reset[root]"
3. Apply changes:
podman compose down && podman compose --profile gitlab up
4. Access GitLab UI:

Visit GitLab UI and login with root/your_new_password

Configuring GitLab Runner

7. Register the runner:
podman exec -it gitlab-runner /bin/bash
gitlab-runner register --url http://10.5.0.5/ --token <your_token>
vi /etc/gitlab-runner/config.toml
8. Configure the runner:

Refer to the example runner configuration at runner.example.toml in this project. Ensure to add necessary settings, including privileged and FF_NET.. for Podman. For more settings, see the GitLab Runner documentation.

9. Restart compose to apply runner configuration:
podman compose down && podman compose up
# Login to UI and check that the runner is online in the admin area

Gitea Setup

ℹ️
10. Add test projects, CI pipelines, and start experimenting!

Gitea setup instructions are to be added.

License

This project is licensed under the Creative Commons CC0-1.0 License - effectively placing it in the public domain. You may use it freely without attribution.

About

An example of how you can run a local GitLab, Gitea Git Provider. Handy for development.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published