BuildBuild
BuildCertified

yaml
type: "io.kestra.plugin.docker.Build"
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-io/polars:latest
    push: true
    credentials:
      username: kestra-io
      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
SubTypestring
SubTypestring
Definitions
authstring
identityTokenstring
passwordstring
registrystring
registryTokenstring
usernamestring
SubTypestring
Definitions
enabledbooleanstring
Defaulttrue
excludearray
SubTypestring
folderPerNamespacebooleanstring
Defaultfalse
ifExistsstring
DefaultOVERWRITE
Possible Values
OVERWRITEFAILWARNIGNORE
includearray
SubTypestring
namespacesarray
SubTypestring
Default["{{flow.namespace}}"]
SubTypestring
Defaulttrue
Defaultfalse
Unitbytes