docker git and file builds

This commit is contained in:
Christian Lempa 2024-04-19 15:23:14 +02:00
parent 743e25a974
commit 650235b83d
2 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,38 @@
# Kestra Docker File Build Template
# ---
#
# Build a Docker image from a File.
#
id: docker-file-build
namespace: # your-namespace
tasks:
- id: file
type: io.kestra.core.tasks.flows.WorkingDirectory
tasks:
- id: createFiles
type: io.kestra.core.tasks.storages.LocalFiles
inputs:
Dockerfile: |
FROM alpine:latest
WORKDIR /app
COPY . /app
RUN apk add --update python3
CMD [ "python", "main.py"]
main.py: |
if __name__ == "__main__":
print("Hello from Docker!")
exit(0)
- id: build
type: io.kestra.plugin.docker.Build
dockerfile: "src/Dockerfile"
tags:
- your-username/your-repository:your-tag
push: true
credentials:
registry: https://index.docker.io/v1/
username: "{{ secret('YOUR_USERNAME') }}"
password: "{{ secret('YOUR_PASSWORD') }}"

View File

@ -0,0 +1,29 @@
# Kestra Docker Git Build Template
# ---
#
# Build a Docker image from a Git repository.
#
id: docker-git-build
namespace: # your-namespace
tasks:
- id: git
type: io.kestra.core.tasks.flows.WorkingDirectory
tasks:
- id: clone
type: io.kestra.plugin.git.Clone
url: https://your-git-repo-url
branch: your-branch
- id: build
type: io.kestra.plugin.docker.Build
dockerfile: "src/Dockerfile"
tags:
- your-username/your-repository:your-tag
push: true
credentials:
registry: https://index.docker.io/v1/
username: "{{ secret('YOUR_USERNAME') }}"
password: "{{ secret('YOUR_PASSWORD') }}"