Compose: Support for overriding WORKDIR

Created on 18 Feb 2017  路  2Comments  路  Source: docker/compose

docker compose already allows for overriding Dockerfile CMD. It would also be nice if there was the ability to override the Dockerfile WORKDIR as well.

For example:

version: '3'
services:
  test:
    build: .
    workdir: /newworkdir
    command: echo "hello"

I believe this is possible because docker run takes --workdir as an option. I didn't see this as an option in the current version of the docker compose documentation.

kinquestion

Most helpful comment

We do, the option's called working_dir !

All 2 comments

We do, the option's called working_dir !

I didn't see that in the docs, thanks!

Was this page helpful?
0 / 5 - 0 ratings