mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
Makefile.docker: Detect if running inside a Docker container
This commit is contained in:
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…
Reference in New Issue
Block a user