docker-build-git.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. ---
  2. # Kestra Docker Git Build Template
  3. # ---
  4. #
  5. # Build a Docker image from a Git repository.
  6. #
  7. id: docker_build_git
  8. namespace: your_namespace # <- Replace with your namespace...
  9. tasks:
  10. - id: docker_job
  11. type: io.kestra.plugin.core.flow.WorkingDirectory
  12. tasks:
  13. - id: git_clone
  14. type: io.kestra.plugin.git.Clone
  15. url: your-git-repository-url # <-- Replace with your Git repository URL...
  16. directory: docker
  17. branch: main # <-- (Optional) Replace with your Git branch...
  18. # --> (Optional) If Git repository is private, add your Git token...
  19. # username: xcad
  20. # password: "{{ secret('GITOKEN') }}"
  21. # <--
  22. - id: docker_build
  23. type: io.kestra.plugin.docker.Build
  24. dockerfile: "docker/src/Dockerfile" # <- Replace with your Dockerfile path...
  25. tags:
  26. - your-username/your-repository:your-tag # <- Replace with your Docker image tag...
  27. push: true
  28. credentials:
  29. registry: https://index.docker.io/v1/
  30. username: "{{ secret('YOUR_USERNAME') }}" # <- Replace with your Docker Hub username...
  31. password: "{{ secret('YOUR_PASSWORD') }}" # <- Replace with your Docker Hub password...