Skip to content

Commit

Permalink
Fix Dockerfile-proxy to error out if fetch fails (#2252)
Browse files Browse the repository at this point in the history
`Dockerfile-proxy` executes several commands following
`bin/fetch-proxy`, but the subsequent commands were separated by
semicolon, so the overall RUN command would succeed regardless of what
`bin/fetch-proxy` returned. This meant that if `bin/docker-build-proxy`
was run on a proxy SHA prior to it being available, it would fail the
build, but cache the unsuccessful `fetch-proxy` command, and continue to
fail after the proxy becomes available.

This change concatenates `fetch-proxy` and subsequent commands using
ampersands, failing the build if `fetch-proxy` fails.

Signed-off-by: Andrew Seigner <siggy@buoyant.io>
  • Loading branch information
siggy committed Feb 13, 2019
1 parent a9b9908 commit f84469b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile-proxy
Expand Up @@ -5,9 +5,9 @@ RUN apt-get update && apt-get install -y ca-certificates
WORKDIR /build
COPY bin/fetch-proxy bin/fetch-proxy
ARG PROXY_VERSION
RUN (proxy=$(bin/fetch-proxy $PROXY_VERSION); \
version=$(basename "$proxy" | sed 's/linkerd2-proxy-//'); \
mv "$proxy" linkerd2-proxy; \
RUN (proxy=$(bin/fetch-proxy $PROXY_VERSION) && \
version=$(basename "$proxy" | sed 's/linkerd2-proxy-//') && \
mv "$proxy" linkerd2-proxy && \
echo "$version" >version.txt)

FROM $RUNTIME_IMAGE as runtime
Expand Down

0 comments on commit f84469b

Please sign in to comment.