mirror of https://github.com/linkerd/linkerd2.git
build: Remove the DOCKER_TRACE environment variable (#5583)
Our build scripts hide docker's output by default and only pass through output when DOCKER_TRACE is set. Practically everyone else tends to use DOCKER_TRACE=1 persistently. And, recently, GitHub Actions stopped working with `/dev/stderr` This change removes the DOCKER_TRACE environment variable so that output is always emitted as it would when invoking docker directly.
This commit is contained in:
parent
08439f1f6e
commit
d2ae5a8117
4
BUILD.md
4
BUILD.md
|
@ -121,7 +121,7 @@ Started](https://linkerd.io/2/getting-started/)
|
||||||
bin/k3d cluster create
|
bin/k3d cluster create
|
||||||
|
|
||||||
# build all docker images
|
# build all docker images
|
||||||
DOCKER_TRACE=1 bin/docker-build
|
bin/docker-build
|
||||||
|
|
||||||
# load all the images into k3d
|
# load all the images into k3d
|
||||||
bin/image-load --k3d
|
bin/image-load --k3d
|
||||||
|
@ -431,7 +431,7 @@ The `bin/docker-build-proxy` script builds the proxy by pulling a pre-published
|
||||||
proxy binary:
|
proxy binary:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
DOCKER_TRACE=1 bin/docker-build-proxy
|
bin/docker-build-proxy
|
||||||
```
|
```
|
||||||
|
|
||||||
### Multi-architecture builds
|
### Multi-architecture builds
|
||||||
|
|
2
TEST.md
2
TEST.md
|
@ -167,7 +167,7 @@ You can also test a locally-built version of the `linkerd` CLI.
|
||||||
First build all of the Linkerd images by running:
|
First build all of the Linkerd images by running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
DOCKER_TRACE=1 bin/docker-build
|
bin/docker-build
|
||||||
```
|
```
|
||||||
|
|
||||||
That command also copies the corresponding `linkerd` binaries into the
|
That command also copies the corresponding `linkerd` binaries into the
|
||||||
|
|
|
@ -11,9 +11,6 @@ bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd )
|
||||||
# docker registry in, for instance, CI.
|
# docker registry in, for instance, CI.
|
||||||
export DOCKER_REGISTRY=${DOCKER_REGISTRY:-ghcr.io/linkerd}
|
export DOCKER_REGISTRY=${DOCKER_REGISTRY:-ghcr.io/linkerd}
|
||||||
|
|
||||||
# When set, causes docker's build output to be emitted to stderr.
|
|
||||||
export DOCKER_TRACE=${DOCKER_TRACE:-}
|
|
||||||
|
|
||||||
# When set, use `docker buildx` and use the github actions cache to store/retrieve images
|
# When set, use `docker buildx` and use the github actions cache to store/retrieve images
|
||||||
export DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-}
|
export DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-}
|
||||||
|
|
||||||
|
@ -50,11 +47,6 @@ docker_build() {
|
||||||
file=$1
|
file=$1
|
||||||
shift
|
shift
|
||||||
|
|
||||||
output=/dev/null
|
|
||||||
if [ -n "$DOCKER_TRACE" ]; then
|
|
||||||
output=/dev/stderr
|
|
||||||
fi
|
|
||||||
|
|
||||||
rootdir=$( cd "$bindir"/.. && pwd )
|
rootdir=$( cd "$bindir"/.. && pwd )
|
||||||
|
|
||||||
if [ -n "$DOCKER_BUILDKIT" ]; then
|
if [ -n "$DOCKER_BUILDKIT" ]; then
|
||||||
|
@ -82,15 +74,13 @@ docker_build() {
|
||||||
$output_params \
|
$output_params \
|
||||||
-t "$repo:$tag" \
|
-t "$repo:$tag" \
|
||||||
-f "$file" \
|
-f "$file" \
|
||||||
"$@" \
|
"$@"
|
||||||
> "$output"
|
|
||||||
else
|
else
|
||||||
log_debug " :; docker build $rootdir -t $repo:$tag -f $file $*"
|
log_debug " :; docker build $rootdir -t $repo:$tag -f $file $*"
|
||||||
docker build "$rootdir" \
|
docker build "$rootdir" \
|
||||||
-t "$repo:$tag" \
|
-t "$repo:$tag" \
|
||||||
-f "$file" \
|
-f "$file" \
|
||||||
"$@" \
|
"$@"
|
||||||
> "$output"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$repo:$tag"
|
echo "$repo:$tag"
|
||||||
|
|
|
@ -2,21 +2,13 @@
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# When set, causes docker's build output to be emitted to stderr.
|
|
||||||
export DOCKER_TRACE=${DOCKER_TRACE:-}
|
|
||||||
export RUST_LOG=${RUST_LOG:-}
|
export RUST_LOG=${RUST_LOG:-}
|
||||||
|
|
||||||
bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd )
|
bindir=$( cd "${BASH_SOURCE[0]%/*}" && pwd )
|
||||||
rootdir=$( cd "$bindir"/.. && pwd )
|
rootdir=$( cd "$bindir"/.. && pwd )
|
||||||
|
|
||||||
if [ -n "$DOCKER_TRACE" ]; then
|
|
||||||
output=/dev/stderr
|
|
||||||
else
|
|
||||||
output=/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker build -f "$rootdir/proxy/Dockerfile" . \
|
docker build -f "$rootdir/proxy/Dockerfile" . \
|
||||||
--target build \
|
--target build \
|
||||||
-t proxy-build \
|
-t proxy-build \
|
||||||
--build-arg=PROXY_UNOPTIMIZED=1 > $output
|
--build-arg=PROXY_UNOPTIMIZED=1
|
||||||
docker run --rm -it proxy-build env RUST_LOG="$RUST_LOG" cargo test "$@"
|
docker run --rm -it proxy-build env RUST_LOG="$RUST_LOG" cargo test "$@"
|
||||||
|
|
Loading…
Reference in New Issue