File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 33#
44all : binary
55
6+ _: =$(shell ./scripts/warn-outside-container $(MAKECMDGOALS ) )
7+
68# remove build artifacts
79.PHONY : clean
810clean :
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -eu
3+
4+ target=" $1 "
5+
6+ if [[ -z " ${DISABLE_WARN_OUTSIDE_CONTAINER:- } " ]]; then
7+ (
8+ echo
9+ echo
10+ echo " WARNING: you are not in a container. Use \" ./tasks $target \" or set"
11+ echo " DISABLE_WARN_OUTSIDE_CONTAINER=1 to disable this warning."
12+ echo
13+ echo
14+ ) >&2
15+ fi
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ dev_image=docker-cli-dev
66linter_image=docker-cli-lint
77cross_image=docker-cli-cross
88
9-
109function run_task {
1110 local task=$1
1211
@@ -36,7 +35,11 @@ function docker_build_and_run {
3635 local dockerfile_source=
3736 local cidfile=
3837 local remove=" --rm"
39- local envvars=" -e VERSION -e GITCOMMIT -e BUILDTIME -e LDFLAGS"
38+ local envvars=" -e VERSION \
39+ -e GITCOMMIT \
40+ -e BUILDTIME \
41+ -e LDFLAGS \
42+ -e DISABLE_WARN_OUTSIDE_CONTAINER=1"
4043 # Use an array to preserve whitespace in $PWD
4144 local mounts=(-v " $PWD :/go/src/github.com/docker/cli" )
4245 if [ -t 1 ] ; then local use_tty=" -ti" ; else local use_tty=" " ; fi
@@ -53,7 +56,14 @@ function docker_build_and_run {
5356 fi
5457
5558 echo " $dockerfile_source " | docker build -t " $image " -f " $dockerfile " .
56- docker run $remove $envvars $cidfile $use_tty ${mounts[@]+" ${mounts[@]} " } " $image " $cmd
59+ docker run \
60+ $remove \
61+ $envvars \
62+ $cidfile \
63+ $use_tty \
64+ ${mounts[@]+" ${mounts[@]} " } \
65+ " $image " \
66+ $cmd
5767}
5868
5969function usage {
You can’t perform that action at this time.
0 commit comments