I'm building a Makefile
to automate the start of docker on osx
.
At the end of the start docker requires to launch this command on the shell in order to configure the shell: eval "$(docker-machine env dev)"
The problem is that if I try to run it on the Makefile, this has no effect on the shell.
In fact, if the launch:
make start
and then make status
I get error from docker.
This is my Makefile:
CURRENT_DIRECTORY := $(shell pwd)
start:
@sh run.sh -d
@eval $(docker-machine env dev)
start-compose:
@docker-compose up -d
clean:
@docker-compose rm --force
stop:
@docker-compose stop
shutdown:
@docker-compose stop
@docker-machine stop dev
build:
@docker-compose build
status:
@docker-compose ps
cli:
@docker-compose run --rm web bash
log:
@docker-compose logs web
logall:
@docker-compose logs
restart:
@docker-compose stop web
@docker-compose start web
restartall:
@docker-compose stop
@docker-compose start
.PHONY: clean start start-compose stop status shutdown build cli log logall restart restartall
Is there a way to launch the eval "$(docker-machine env dev)"
command on the Makefile and that will affect the shell?