docker-build-inline.yaml 1.2 KB

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