there are some possible issues to have docker related files in a dedicated folder.
When you would like to start an environment with docker-compose, you can do it with a command like this.
docker-compose up -d
but it will work only if the docker-compose.yml file name has not changed and it lays right in the current folder.
if you change its location or name, you will have to specify the new place
docker-compose -f ./docker/docker-compose.yml up -d
became not so simple, right?
Ok, next about Dockerfile.
when you build docker image, you have to specify context. So, the command below, just uses file Dockerfile in the current folder, and uses current folder as a context for build.
docker build .
To build docker image with Dockerfile placed somewhere else, you should specify it, suppose you still would like to have current folder as context.
docker build -f ./docker/Dockerfile .
any other files in the root, such as Installer.cls, irissession.sh or any other files which should be used during docker build have to be available from specified context folder. And you can't specify more than one context. So, any of those files should have some parent folder at least, and why not the root of a project.
with docker-compose.yml, we forget about docker build command, but we still have to care about docker-compose
- Log in to post comments
.png)
.png)
.png)