I am trying to build a docker container using a makefile:
up_build_dev:
@echo "Stopping docker images (if running...)"
docker-compose down
@echo "Building (when required) and starting docker images..."
DB_USER=backend DB_PASSWORD=password DB_ROOT_USER=root DB_ROOT_PASSWORD=password DB_NAME=my_db DB_PORT=3306 DB_HOST=mysql LISTEN_PORT=80 HOST_PORT=8080 ENV=dev docker-compose up --build -d
@echo "Docker images built and started!"
The environment variables are not passed, however, when I run this compose command in my terminal without make it works just fine.
I tried using export
and env
keywords but it didn’t work.
PS this is a test db and a dev container so I don’t care if I expose any passwords.