Makefile.docker: Detect if running inside a Docker container

dev/timer
Joakim Gebart 8 years ago
parent 75f38c026b
commit da74abc8c9

@ -8,6 +8,14 @@ export DOCKER_MAKECMDGOALS_POSSIBLE = \
#
export DOCKER_MAKECMDGOALS = $(filter $(MAKECMDGOALS),$(DOCKER_MAKECMDGOALS_POSSIBLE))
# Docker creates the files .dockerinit and .dockerenv in the root directory of
# the container, we check for the files to determine if we are inside a container.
ifneq (,$(wildcard /.dockerinit /.dockerenv))
export INSIDE_DOCKER := 1
else
export INSIDE_DOCKER := 0
endif
# Default target for building inside a Docker container if nothing was given
export DOCKER_MAKECMDGOALS ?= all
# List of all exported environment variables that shall be passed on to the

Loading…
Cancel
Save