mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add a check to make sure that make.sh only runs within a container.
This commit is contained in:
parent
d9f769930b
commit
749a7d0e4f
1 changed files with 10 additions and 0 deletions
10
make.sh
10
make.sh
|
@ -21,6 +21,16 @@
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
# We're a nice, sexy, little shell script, and people might try to run us;
|
||||||
|
# but really, they shouldn't. We want to be in a container!
|
||||||
|
RESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
|
||||||
|
grep -q "$RESOLVCONF" /proc/mounts || {
|
||||||
|
echo "# I will only run within a container."
|
||||||
|
echo "# Try this instead:"
|
||||||
|
echo "docker build ."
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
VERSION=$(cat ./VERSION)
|
VERSION=$(cat ./VERSION)
|
||||||
GIT_COMMIT=$(git rev-parse --short HEAD)
|
GIT_COMMIT=$(git rev-parse --short HEAD)
|
||||||
GIT_CHANGES=$(test -n "$(git status --porcelain)" && echo "+CHANGES" || true)
|
GIT_CHANGES=$(test -n "$(git status --porcelain)" && echo "+CHANGES" || true)
|
||||||
|
|
Loading…
Reference in a new issue