diff --git a/fig/service.py b/fig/service.py index f21302f63..c0cc297c4 100644 --- a/fig/service.py +++ b/fig/service.py @@ -11,7 +11,7 @@ from .progress_stream import stream_output, StreamOutputError log = logging.getLogger(__name__) -DOCKER_CONFIG_KEYS = ['image', 'command', 'hostname', 'user', 'detach', 'stdin_open', 'tty', 'mem_limit', 'ports', 'environment', 'dns', 'volumes', 'entrypoint', 'privileged', 'volumes_from', 'net'] +DOCKER_CONFIG_KEYS = ['image', 'command', 'hostname', 'user', 'detach', 'stdin_open', 'tty', 'mem_limit', 'ports', 'environment', 'dns', 'volumes', 'entrypoint', 'privileged', 'volumes_from', 'net', 'working_dir'] DOCKER_CONFIG_HINTS = { 'link' : 'links', 'port' : 'ports', @@ -19,6 +19,7 @@ DOCKER_CONFIG_HINTS = { 'priviliged': 'privileged', 'privilige' : 'privileged', 'volume' : 'volumes', + 'workdir' : 'working_dir', } VALID_NAME_CHARS = '[a-zA-Z0-9]' diff --git a/tests/integration/service_test.py b/tests/integration/service_test.py index a8fb102a1..315e14ce3 100644 --- a/tests/integration/service_test.py +++ b/tests/integration/service_test.py @@ -301,3 +301,8 @@ class ServiceTest(DockerClientTestCase): service = self.create_service('web', net='host') container = service.start_container().inspect() self.assertEqual(container['HostConfig']['NetworkMode'], 'host') + + def test_working_dir_param(self): + service = self.create_service('container', working_dir='/working/dir/sample') + container = service.create_container().inspect() + self.assertEqual(container['Config']['WorkingDir'], '/working/dir/sample')