I'm running make for windows. ( choco install make
)
pretty much everything is working out fine until i'm trying to build a docker container, specifically to deploy on Amazon ECS....
Part of the ECS deploy process is you get a login from AWS
aws ecr get-login
this returns a string containing a command that looks like
docker login -u AWS -p AQEC...HGZSSUMX4ftIpo8gY2 -e none https://123456789.dkr.ecr.us-east-1.amazonaws.com
if i was just running this from the shell i would copy the output and past it onto the commandline and run - but I'm trying to put this into my makefile so i have
@ECS_LOGIN =$(shell aws ecr get-login)
and then I'm trying to execute it on the next line
$(ECS_LOGIN)
and thats where i get
process_begin: CreateProcess(NULL, ECS_LOGIN =docker login -u AWS -p AQEC...HGZSSUMX4ftIpo8gY2 -e none https://123456789.dkr.ecr.us-east-1.amazonaws.com, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [docker-deploy] Error 2
from researching other questions this seems like a pathing issue when running from windows Makefile error make (e=2): The system cannot find the file specified
but docker commands prior to my aws ecr get-login
work just fine
ie
docker build
so it seems specific to running the command out of the variable
So how do i run this command from make and have the path resolve?
full recipe
docker-deploy: docker-build
@ECS_LOGIN =$(shell aws ecr get-login)
$(ECS_LOGIN)
docker tag mytag:latest 123456789.dkr.ecr.us-east-1.amazonaws.com/mytag:latest
docker push 123456789.dkr.ecr.us-east-1.amazonaws.com/mytag:latest