No description
- Dockerfile 100%
| .gitlab-ci.yml | ||
| Dockerfile | ||
| gitlab-runner.config.toml | ||
| gitlab-runner.yaml | ||
| kubernetes.png | ||
| README.md | ||
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.