Files
docker-cli/components/cli/scripts/warn-outside-container
Daniel Nephin 8adcc1277a Add a warning when make is run outside of a container.
The warning can be disabled by setting the environment variable

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 12a7387c8e
Component: cli
2017-07-26 15:58:15 -04:00

19 lines
415 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
target="${1:-}"
if [[ -z "${DISABLE_WARN_OUTSIDE_CONTAINER:-}" ]]; then
(
echo
echo
echo "WARNING: you are not in a container."
echo "Use \"make -f docker.Makefile $target\" or set"
echo "DISABLE_WARN_OUTSIDE_CONTAINER=1 to disable this warning."
echo
echo "Press Ctrl+C now to abort."
echo
) >&2
sleep 10
fi