Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Docker command is not executed in the container working directory #190

Closed
lgilz opened this issue Apr 25, 2018 · 3 comments
Closed

Docker command is not executed in the container working directory #190

lgilz opened this issue Apr 25, 2018 · 3 comments
Assignees
Milestone

Comments

@lgilz
Copy link

lgilz commented Apr 25, 2018

I would expect that the command in the job description job_specifications.tasks.command of the jobs.yaml leads to the same result as when I use docker run. However, the command option in the job definition seems to overwrite the containers working directory to be $AZ_BATCH_TASK_WORKING_DIR. This is a non-standard procedure and very confusing.

I would expect that shipyard jobs add with the following jobs.yaml produces the same output as docker run busybox pwd.

Instead docker run busybox pwd outputs / and the shipyard job outputs /mnt/batch/tasks/workitems/test/job-1/task-00007/wd. Therefore, if I would want to run code in my own container, I first had to change to the right working directory. I would very much appreciate if you change that behavior - or at least state this very clear in the documentation.

jobs.yaml

job_specifications:
- id: test
  tasks:
  - docker_image: busybox
    command: pwd
@alfpark
Copy link
Collaborator

alfpark commented Apr 25, 2018

You are correct, this information is missing from the documentation.

@alfpark alfpark added this to the 3.5 milestone Apr 25, 2018
@alfpark alfpark self-assigned this Apr 25, 2018
@alfpark
Copy link
Collaborator

alfpark commented Apr 25, 2018

I will also add an option to control the default as using -w in additional_docker_run_options is not intuitive.

alfpark added a commit that referenced this issue Apr 25, 2018
- Clarify where a container runs by default in the jobs config doc
- Resolves #190
@lgilz
Copy link
Author

lgilz commented Apr 26, 2018

That looks good! I'm really impressed by the quick response rate! Keep up the good work!

@alfpark alfpark closed this as completed in 69235ba May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants