Skip to content

feat: add GitLab Runner entrypoint and non-root user support#3

Merged
thpham merged 1 commit into
mainfrom
feat/gitlab-runner-entrypoint
Nov 1, 2025
Merged

feat: add GitLab Runner entrypoint and non-root user support#3
thpham merged 1 commit into
mainfrom
feat/gitlab-runner-entrypoint

Conversation

@thpham

@thpham thpham commented Nov 1, 2025

Copy link
Copy Markdown
Owner

Add entrypoint script as Nix derivation using pkgs.writeShellScript:

  • Handles custom CA certificate injection for Nix containers
  • Combines custom CA with system cacert bundle
  • Sets SSL_CERT_FILE and NIX_SSL_CERT_FILE environment variables
  • Creates /etc/gitlab-runner directory
  • Launches gitlab-runner with all passed arguments

Configure container to run as non-root user:

  • Set User to gitlab-runner:gitlab-runner (UID/GID 999)
  • Create /etc/passwd and /etc/group files
  • Create necessary directories (/etc/gitlab-runner, /home/gitlab-runner, /tmp)
  • Set world-writable permissions on /tmp

Add entrypoint script as Nix derivation using pkgs.writeShellScript:
- Handles custom CA certificate injection for Nix containers
- Combines custom CA with system cacert bundle
- Sets SSL_CERT_FILE and NIX_SSL_CERT_FILE environment variables
- Creates /etc/gitlab-runner directory
- Launches gitlab-runner with all passed arguments

Configure container to run as non-root user:
- Set User to gitlab-runner:gitlab-runner (UID/GID 999)
- Create /etc/passwd and /etc/group files
- Create necessary directories (/etc/gitlab-runner, /home/gitlab-runner, /tmp)
- Set world-writable permissions on /tmp
@thpham
thpham marked this pull request as ready for review November 1, 2025 14:56
@thpham
thpham merged commit 5b4d777 into main Nov 1, 2025
4 checks passed
@thpham
thpham deleted the feat/gitlab-runner-entrypoint branch November 1, 2025 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant