I'm using:
- Windows 10
- make 3.81
- docker CE 18.09.2
- docker compose 1.23.2
- git bash 2.22.0.windows.1
I've got a docker-compose.yaml
file that looks like this:
version: '3.2'
services:
terraform:
image: hashicorp/terraform:0.11.14
entrypoint: terraform
working_dir: /var/tmp/code/
volumes:
- .:/var/tmp/code/:rw
And my Makefile
looks like this
init:
docker-compose run terraform init
When I run this from the GitBash command line:
make init
I get the following output
docker-compose run terraform init
process_begin: CreateProcess(NULL, docker-compose run terraform init, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [init] Error 2
I've seen other posts relating to this, and understand this to be a problem with the values on my PATH
environment variable, however I'm not sure how to correct the problem.
Please let me know if I can provide any more information
Update
I have confirmed that:
docker-compose
is installed- the
docker-compose.exe
exists on my PATH environment variable (see below)
My PATH environment variable:
Update 2
If I modify the makefile so it explicitly states the path to the docker-compose.exe
file, it works:
init:
"/c/Program Files/Docker/Docker/resources/bin/docker-compose.exe" run terraform init
Update 3 - Solution
So my full Makefile
actually looked like this:
#!make
include .env
export
.env:
@[ -f ./.env-aws ] && source ./.env-aws; env | grep AWS | sed 's/export //g; s/"//g' > .env
init-test:
docker-compose run terraform init
Running make .env
creates a .env file
, which included a PATH env var
AWS_SECRET_ACCESS_KEY=...
AWS_SESSION_TOKEN=...
AWS_ACCESS_KEY_ID=...
PATH=...
Deleting the PATH
line from this file solve it for me :)