Build ​Build

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/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
SubType string
SubType string
SubType string
SubType string
Default true
Default false
Default true
SubType string
Default false
Default OVERWRITE
Possible Values
OVERWRITEFAILWARNIGNORE
SubType string
SubType string
Default ["{{flow.namespace}}"]