Export current user id in makefile for docker-compose
Here is my solution
#!/usr/bin/make
SHELL = /bin/sh
CURRENT_UID := $(shell id -u)
CURRENT_GID := $(shell id -g)
export CURRENT_UID
export CURRENT_GID
up:
docker-compose up -d
Another option is to use env
:
Makefile:
SHELL=/bin/bash
UID := $(shell id -u)
up:
env UID=${UID} docker-compose up -d