Build
yaml
type: "io.kestra.plugin.docker.build"
Examples
yaml
id: docker_build
namespace: company.team
tasks:
- id: build
type: io.kestra.plugin.docker.Build
push: true
dockerfile: |
FROM ubuntu
ARG APT_PACKAGES=""
RUN apt-get update && apt-get install -y --no-install-recommends ${APT_PACKAGES};
platforms:
- linux/amd64
tags:
- private-registry.io/unit-test:latest
buildArgs:
APT_PACKAGES: curl
labels:
unit-test: "true"
credentials:
registry: <registry.url.com>
username: "{{ secret('DOCKERHUB_USERNAME') }}"
password: "{{ secret('DOCKERHUB_PASSWORD') }}"
yaml
id: build_dockerhub_image
namespace: company.team
tasks:
- id: build
type: io.kestra.plugin.docker.Build
dockerfile: |
FROM python:3.10
RUN pip install --upgrade pip
RUN pip install --no-cache-dir kestra requests "polars[all]"
tags:
- kestra/polars:latest
push: true
credentials:
registry: https://index.docker.io/v1/ # for now only V1 is supported until https://github.com/kestra-io/plugin-docker/issues/66
username: "{{ secret('DOCKERHUB_USERNAME') }}"
password: "{{ secret('DOCKERHUB_PASSWORD') }}"
yaml
id: build_github_container_image
namespace: company.team
tasks:
- id: build
type: io.kestra.plugin.docker.Build
dockerfile: |
FROM python:3.10
RUN pip install --upgrade pip
RUN pip install --no-cache-dir kestra requests "polars[all]"
tags:
- ghcr.io/kestra/polars:latest
push: true
credentials:
username: kestra
password: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
yaml
id: build_task_runner_image
namespace: company.team
tasks:
- id: build
type: io.kestra.plugin.docker.Build
tags:
- my-py-data-app
dockerfile: |
FROM python:3.12-slim
WORKDIR /app
RUN pip install --no-cache-dir pandas
COPY . /app
- id: python
type: io.kestra.plugin.scripts.python.Commands
containerImage: "{{ outputs.build.imageId }}"
taskRunner:
type: io.kestra.plugin.scripts.runner.docker.Docker
pullPolicy: NEVER
namespaceFiles:
enabled: true
commands:
- python main.py
Properties
buildArgs object
SubType string
config stringobject
credentials Credentials
dockerfile string
host string
inputFiles objectstring
labels object
SubType string
namespaceFiles Non-dynamicNamespaceFiles
platforms array
SubType string
pull booleanstring
Default
true
push booleanstring
Default
false
Outputs
imageId string
Definitions
io.kestra.core.models.tasks.NamespaceFiles
enabled booleanstring
Default
true
exclude array
SubType string
folderPerNamespace booleanstring
Default
false
ifExists string
Default
OVERWRITE
Possible Values
OVERWRITE
FAIL
WARN
IGNORE
include array
SubType string
namespaces array
SubType string
Default
["{{flow.namespace}}"]