Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a Bash task, declaring a volume binding overwrites default mount #801

Closed
Melkaz opened this issue Oct 24, 2022 · 0 comments
Closed

In a Bash task, declaring a volume binding overwrites default mount #801

Melkaz opened this issue Oct 24, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Melkaz
Copy link

Melkaz commented Oct 24, 2022

Expected Behavior

Mounting /tmp to be accessible in a Bash task, executed in a container

id: test-volumes
namespace: io.kestra.flows.test
revision: 2
tasks:
  - id: task1
    type: io.kestra.core.tasks.scripts.Bash
    commands:
      - echo "Hello world 1" > /tmp/file1.txt
      - echo "Hello world 2" > {{ outputFiles['file2.txt'] }}
    dockerOptions:
      image: ubuntu:20.04
      volumes:
        - /tmp:/tmp
    outputFiles:
      - file2.txt
    runner: DOCKER
    
  - id: task2
    type: io.kestra.core.tasks.scripts.Bash
    commands:
      - cat /tmp/file1.txt
      - cat file2.txt
    dockerOptions:
      image: ubuntu:20.04
      volumes:
        - /tmp:/tmp
    inputFiles:
      file2.txt: "{{ outputs['task1'].outputFiles['file2.txt'] }}"
    runner: DOCKER

Actual Behaviour

INFO     2022-10-24 14:41:30.490Hello world 1
WARN     2022-10-24 14:41:30.490cat: file2.txt: No such file or directory
ERROR    2022-10-24 14:41:30.510Command failed with code 1
TRACE    2022-10-24 14:41:30.510io.kestra.core.tasks.scripts.AbstractBash$BashException: Command failed with code 1
	at io.kestra.core.tasks.scripts.runners.DockerScriptRunner.run(DockerScriptRunner.java:286)
	at io.kestra.core.tasks.scripts.AbstractBash.run(AbstractBash.java:293)
	at io.kestra.core.tasks.scripts.AbstractBash.run(AbstractBash.java:223)
	at io.kestra.core.tasks.scripts.Bash.run(Bash.java:95)
	at io.kestra.core.tasks.scripts.Bash.run(Bash.java:22)
	at io.kestra.core.runners.Worker$WorkerThread.run(Worker.java:499)

Steps To Reproduce

No response

Environment Information

  • Kestra Version: 0.5.2-SNAPSHOT
  • Operating System (OS / Docker / Kubernetes):
  • Java Version (If not docker):

Example flow

No response

@Melkaz Melkaz added the bug Something isn't working label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant