question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Workdir of docker container is overwritten

See original GitHub issue

I’m trying to get my workflow up and running with digdag and docker. After starting the container, the workdir which is defined in the Dockerfile of the container gets overwritten. I can’t seem to find a way to set the workdir properly.

Example Workflow:

timezone: UTC
_export:
  MINIO_HOST: "127.0.0.1:9001"
  MINIO_USERNAME: "minio"
  MINIO_PASSWORD: "minio"

+my_task_1:
  _workdir: "/usr/src/app"
  _export:
    docker:
      image: python:3
  for_each>:
    crawler: [abc, def]
  _do:
    sh>: pwd

The output is something like this: /tmp/digdag-tempdir3664891302268477936/workspace/3_report_32_180_1070820252556486184

My use-case is, that I have a work-flow that consists of multiple steps, each step is somewhat complex and has it’s own docker container with it’s own entrypoint and workdir.

Another problem is, that I’m not sure how to pass intermediate results / data between steps or how to scale this application onto multiple servers (e.g. have multiple workers)? Is there any documentation on this that I missed? The documentation only says:

Tasks can run on local machine, distributed servers, or in a Docker container.

Thanks! I really like digdag.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hiroyuki-satocommented, Sep 3, 2018

Hello, @David-Development

MicroAd(one of Digdag user company in Japan) use Digdag with Docker. https://developers.microad.co.jp/entry/2018/05/24/131136

They use py> operator for executing a query in Hadoop. They don’t process datum in Docker container. Instead, datum stored in Hadoop. so, Digdag becomes scalable.

They also use S3 and s3_wait> operator for waiting for task completion.

1reaction
grezarcommented, Sep 3, 2018

Hi, @David-Development As far as I know, there isn’t a way to avoid overwritting workdir if you run docker by digdag. You may use sh>: operator to run docker like below

timezone: UTC
_export:
  MINIO_HOST: "127.0.0.1:9001"
  MINIO_USERNAME: "minio"
  MINIO_PASSWORD: "minio"

+my_task_1:
  for_each>:
    crawler: [abc, def]
  _do:
    sh>: docker run --rm python:3 pwd

[FYI] you can also use for_range operator instead of for_each to run subtasks multiple times. https://docs.digdag.io/operators/for_range.html#for-range-repeat-tasks-for-a-range

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to overwrite a file in work directory from docker file?
1 Answer 1 · FROM node:11-alpine ARG BUILD_ENV=sprint WORKDIR /app COPY . /app # copy the configuration for the target environment COPY ./ ......
Read more >
Dockerfile reference - Docker Documentation
A Dockerfile is a text document that contains all the commands a user could call on the ... FROM busybox ENV FOO=/bar WORKDIR...
Read more >
Understanding the Dockerfile Commands - DEV Community ‍ ‍
Choose CMD if you need to provide a default command and/or arguments that can be overwritten from command line when docker container runs....
Read more >
How to overwrite a file in work directory from docker file?
Should work ok, assuming you mean s.js not x.js (your comment and code differ). Some syntax changes below, that shouldn't matter but for...
Read more >
Working with docker bind mounts and node_modules - burnedikt
it overwrites node modules that have been installed within the docker container but not on the host machine. This can e.g. happen, because ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found