Posts

Showing posts with the label Docker Compose

Context Or Workdir For Docker-compose

Answer : I think you're looking for working_dir . Search for "working_dir" in the docker-compose reference. You can specify the working directory as follows. version: '2' services: test: build: context: ./dir working_dir: /dir The build configuration in Docker Compose just ends up in a call to docker build , so you need to have a Dockerfile to use that workflow. As the docs for python:onbuild say, you can start with a minimal Dockerfile that just contains FROM python:onbuild . But as they also say, :onbuild isn't a great option, you'll have much more control building your own Dockerfile FROM python .