Skip to content

[Bash2.0] Docker runner: .Commands runs as the image user in a root-owned working directory, so outputFiles fails #411

Closed

Description

@Pradumnasaraf

Describe the issue

On the Docker task runner, the working directory is created as root:root but .Commands tasks run as the image user. On any non-root image the script cannot write to its own working directory, so outputFiles fails.

.Script tasks on the same image run as uid 0 and work fine.

This affects the groovy plugin's default image groovy:jdk21 (USER groovy, uid 1000).

Visuals and Reproducibility

Image

Run the flow below.

Actual: uid=1000(groovy), dir drwxr-xr-x 2 root root, FileNotFoundException: out.txt (Permission denied), Captured 0 output file(s).
Expected: the file is written and captured.

The same write as a groovy.Script task on the same image logs UID=0 and captures 1 file. Adding user: "0" to the runner also makes this pass.

id: docker_workdir_user_mismatch
namespace: company.team

tasks:
  - id: commands_on_nonroot_image
    type: io.kestra.plugin.scripts.groovy.Commands
    taskRunner:
      type: io.kestra.plugin.scripts.runner.docker.Docker
    containerImage: groovy:jdk21
    outputFiles:
      - out.txt
    commands:
      - "id"
      - "ls -ld ."
      - "groovy -e 'new File(\"out.txt\").text = \"hello\"'"

Environment

Kestra Version: 2.0.0-rc10, commit 9900dcf
Plugin Version: io.kestra.plugin.scripts 1.9.8
Setup: Standalone with Postgres, Kestra EE

Activity

  1. added
    area/plugin
    on Aug 24, 2026
  2. added theissue type on Aug 24, 2026
  3. self-assigned this
    on Sep 2, 2026
  4. added a commit that references this issue on Sep 2, 2026
    9c73355
  5. Pradumnasaraf commented on Sep 3, 2026

    @Pradumnasaraf
    MemberAuthor

    Working. QA done ✅

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/plugin

Type

Fields

Stage

Done

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions