file-build.yaml 1.4 KB

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