Defining context in docker compose - Error: Cannot locate specified Dockerfile: Dockerfile

Hello @azharuddin , Hello @riyawilliams ,

I’m afraid the original question takes realtive paths into account.
The build context is specified as “.” with the dockerfile specified relative to . as “./cv/cv_driver/Dockerfile.template”. Building with these arguments however ignores the container completely.

I’m sorry but I think I don’t quite understand your example @riyawilliams . I know how it should work in principle. e.g the docker-compose.yml in your example should have a build context of “.” and a dockerfile of “./dockerfile/Dockerfile.test” but this won’t currently work in a multicontainer setup. It just ignores the container with those settings completely.

Edit: @lv82 Using the build directive like that works, yes, but you have no access to files and folders from the top level (the level at which the docker-compose resides) from the inside of the specified Dockerfile, because the context will be the parent directory of the Dockerfile, not the docker-compose.
(Actually this is our current approach, we would just like to load some folders from the top level from multiple Dockerfiles residing within some subfolders)

Greetings, Tarek