No description
  • Dockerfile 100%
Find a file
2024-03-31 20:43:12 +00:00
.gitlab-ci.yml Update .gitlab-ci.yml file 2024-03-29 00:33:41 +00:00
Dockerfile Update Dockerfile 2024-03-31 20:43:12 +00:00
gitlab-runner.config.toml Update gitlab-runner.config.toml 2024-03-29 17:12:28 +00:00
gitlab-runner.yaml Update gitlab-runner.yaml 2024-03-29 17:21:34 +00:00
kubernetes.png Gitlab-Runner docker image on kubernetes w/ PHP 8.3, NPM and NodeJS 2024-03-28 22:55:24 +00:00
README.md Update README.md 2024-03-29 16:22:35 +00:00

Gitlab-Runner Docker Build to Kubernetes - Cheat sheet

BUILD

  • docker build -t gitlab-runner-dalom .

Push to Desktop docker "Registry" service

  • docker tag gitlab-runner localhost:5000/gitlab-runner:1.08
  • docker push localhost:5000/gitlab-runner:1.08

Push to docker.com Hub

docker tag gitlab-runner baudchaser/dalom-gitrunner:1.08 docker push baudchaser/dalom-gitrunner:1.08

Creating Secret on a private docker.com repository:

  • "-n default" means "-n namespace"

Create a Kubernetes (on Master) credential secret:

  • kubectl create secret docker-registry regcred --docker-username= --docker-password=<your_docker.com_hub_password> --docker-email=your@email.com -n default
  • docker login -u

means the namespace you've given on docker.com Hub

  • docker tag gitlab-runner /:gitlab-runner
  • docker push /:gitlab-runner

Apply to Kubernetes Cluster (see git project for further explanation)

  • kubectl apply -f .\gitlab-runner.yaml

If you want to check the build in docker and RUN it on a build machine

  • docker run -it --entrypoint /bin/bash gitlab-runner

Kubernetes hints

  • kubectl delete deployment gitlab-runner-dalom-deployment
  • kubectl describe pods gitlab-runner-dalom-deployment-567f7685d6-ln8qp

Important files

  • gitlab-runner-config.toml - Add your Gitlab Runner(s) secrets here)
  • gitlab-runner.yaml - Kubernetes, apply with "kubectl apply -f gitlab-runner.yaml" on a master)
  • Dockerfile (The build instructions for Docker.

A rather brutal Dockerfile.

  • It goes against a lot of the principles behind Docker and Kubernetes, but in this case I chose to ignore that and simplify my life by wrapping all of whole build needs into one container with multiple layers. We mainly need PHP 8.3, NPM and Javascript-Obfuscator. The rest on the image is depencencies. This image is meant to be run behind closed walls, not in any way public. There are major security concerns having a full version of Ubuntu 22.04 available running with root privileges like this.

DO NOT build, install and run unless you know what you are doing.