docker-build-inline.yaml 1.2 KB

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