kestra-io / kestra-io/plugin-docker

Dockerfiles with TARGETARCH and TARGETOS do not respect `platforms` values

Open
#40 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/plugin good first issue
Dominant language
Java
Stars
4
Forks
7
Avg merge
4d 14h
Merged PRs (30d)
3

Description

Describe the issue

When trying to build a docker image that has the following blocks, the build args are not being auto generated.

ARG TARGETOS
ARG TARGETARCH

Once I hardcode those via buildArgs, the build works.

buildArgs:
   TARGETARCH: amd64
   TARGETOS: linux

This is the flow code I'm using:

id: docker_build
namespace: github-runner
description: Build github runner Docker image
disabled: false

labels:
  component: github-runner

inputs:
  - id: release
    type: STRING
    defaults: v2.321.0

triggers:
  - id: listen_release_trigger
    type: io.kestra.plugin.core.trigger.Flow
    inputs:
      release: "{{ outputs.release.values.latest ?? inputs.release }}"
    conditions:
      - type: io.kestra.plugin.core.condition.ExecutionFlowCondition
        namespace: github-runner
        flowId: release_trigger
      - type: io.kestra.plugin.core.condition.ExecutionStatusCondition
        in:
          - SUCCESS
    
tasks:
  - id: build
    type: io.kestra.plugin.core.flow.WorkingDirectory
    tasks:
      - id: git_pull
        type: io.kestra.plugin.git.Clone
        branch: main
        url: https://github.com/actions/runner.git
      - id: image
        retry: 
          type: constant
          maxAttempt: 5
          interval: PT5M
        type: io.kestra.plugin.docker.Build
        dockerfile: images/Dockerfile
        buildArgs:
          RUNNER_VERSION: "{{ inputs.release | substringAfter('v') }}"
          TARGETARCH: amd64
          TARGETOS: linux
        tags:
          - danlsgiga/github-runner:latest
          - "danlsgiga/github-runner:{{ inputs.release | substringAfter('v') }}"
        platforms:
          - linux/amd64
Environment
  • Kestra Version: v0.19.11

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the flow using images/Dockerfile and platforms: linux/amd64, first comparing the build with and without explicit TARGETOS and TARGETARCH buildArgs. Trace how the Docker build task handles platforms and automatic build arguments; done means the Dockerfile receives linux and amd64 without manually supplied values.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.