This demo relates to changes introduced by docker/compose#6134
The understanding is that --project-directory
will allow you run start up a docker-compose from another directory by specifying the 'project directory'. The understanding is that it will also load the .env
file within that directory.
This pull request is only included in the latest release so ensure you're using docker-compose from https://github.com/docker/compose/releases/tag/1.23.0-rc3.
- Run
docker-compose --project-directory docker up
from the root of the project
The docker container is started using the .env
file.
ERROR:
Can't find a suitable configuration file in this directory or any
parent. Are you in the right directory?
Supported filenames: docker-compose.yml, docker-compose.yaml
- Run
docker-compose --project-directory docker -f docker/docker-compose.yml up
from the root of the project
The docker container is started using the .env
file.
ERROR:
WARNING: The TAG variable is not set. Defaulting to a blank string.
ERROR: no such image: java:: invalid reference format
- Run
docker-compose --project-directory docker config
from the root of the project
services:
java:
command: java -version
image: java:alpine
version: '3.1'