file-build.yaml 982 B

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