kaniko-gogs.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. # Kaniko builds images without docker
  3. #
  4. # NOTES:
  5. # If this is your first kaniko, you need to add a token:
  6. # In gogs: User->Settings->Applications
  7. # kubectl create secret generic git-token --from-literal='GIT_TOKEN=<your-token>'
  8. #
  9. # You need to add credentials to the docker registry:
  10. # kubectl create secret docker-registry docker-regcred \
  11. # --docker-server=https://index.docker.io/v1/ \
  12. # --docker-username=<your-username> \
  13. # --docker-password=<your-password>
  14. apiVersion: v1
  15. kind: Pod
  16. metadata:
  17. generateName: kaniko-gogs
  18. spec:
  19. containers:
  20. - name: kaniko-gogs-
  21. image: gcr.io/kaniko-project/executor:v1.9.1
  22. args:
  23. - "--dockerfile=./Dockerfile"
  24. - "--context=git://git.monkeybox.org/Containers/gogs#refs/heads/main"
  25. - "--destination=fdamstra/gogs:latest"
  26. env:
  27. - name: GIT_TOKEN
  28. valueFrom:
  29. secretKeyRef:
  30. name: git-token
  31. key: GIT_TOKEN
  32. volumeMounts:
  33. - name: docker-config
  34. mountPath: /kaniko/.docker/
  35. dnsPolicy: "None"
  36. dnsConfig:
  37. nameservers:
  38. - 10.42.42.239
  39. - 10.42.42.1
  40. searches:
  41. - default.svc.cluster.local
  42. - svc.cluster.local
  43. - cluster.local
  44. options:
  45. - name: ndots
  46. value: "2"
  47. - name: edns0
  48. - name: trust-ad
  49. restartPolicy: Never
  50. volumes:
  51. - name: docker-config
  52. secret:
  53. secretName: docker-regcred
  54. items:
  55. - key: .dockerconfigjson
  56. path: config.json