Add -w or --workdir to compose run to override workdir from commandline

Signed-off-by: Simon van der Veldt <simon.vanderveldt@gmail.com>
This commit is contained in:
Simon van der Veldt 2016-02-22 21:05:59 +01:00 committed by Daniel Nephin
commit 658803edf8
5 changed files with 30 additions and 0 deletions

View file

@ -527,6 +527,7 @@ class TopLevelCommand(object):
to the host.
-T Disable pseudo-tty allocation. By default `docker-compose run`
allocates a TTY.
-w, --workdir="" Working directory inside the container
"""
service = self.project.get_service(options['SERVICE'])
detach = options['-d']
@ -576,6 +577,9 @@ class TopLevelCommand(object):
if options['--name']:
container_options['name'] = options['--name']
if options['--workdir']:
container_options['working_dir'] = options['--workdir']
run_one_off_container(container_options, self.project, service, options)
def scale(self, options):