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.



Comments

Popular posts from this blog

Android - ImageView With Rounded Only One Corner

530 Valid Hostname Is Expected When Setting Up IIS 10 For Multiple Sites

403 Access Denied On Tomcat 8 Manager App Without Prompting For User/password