file-build.yaml 985 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. ---
  2. # Kestra Docker File Build Template
  3. # ---
  4. #
  5. # Build a Docker image from a File.
  6. #
  7. id: docker-file-build
  8. namespace: # your-namespace
  9. tasks:
  10. - id: file
  11. type: io.kestra.core.tasks.flows.WorkingDirectory
  12. tasks:
  13. - id: createFiles
  14. type: io.kestra.core.tasks.storages.LocalFiles
  15. inputs:
  16. Dockerfile: |
  17. FROM alpine:latest
  18. WORKDIR /app
  19. COPY . /app
  20. RUN apk add --update python3
  21. CMD [ "python", "main.py"]
  22. main.py: |
  23. if __name__ == "__main__":
  24. print("Hello from Docker!")
  25. exit(0)
  26. - id: build
  27. type: io.kestra.plugin.docker.Build
  28. dockerfile: "src/Dockerfile"
  29. tags:
  30. - your-username/your-repository:your-tag
  31. push: true
  32. credentials:
  33. registry: https://index.docker.io/v1/
  34. username: "{{ secret('YOUR_USERNAME') }}"
  35. password: "{{ secret('YOUR_PASSWORD') }}"