Fix dockerfile (#1500)

PR #1479 changed the docker base image to not include a shell, which
broke the dockerfile's logic for skipping the identity wrapper. It's no
longer possible to run the proxy without identity, so this functionality
isn't needed in any case.

This change fixes the Dockerfile and adds a CI workflow to test docker
builds on Dockerfile changes.

Signed-off-by: Oliver Gould <ver@buoyant.io>
This commit is contained in:
Oliver Gould 2022-02-15 10:04:02 -08:00 committed by GitHub
parent 87adcdaa77
commit 71f08a8b09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 9 deletions

19
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: docker
on:
pull_request:
paths:
- Dockerfile
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
env:
DOCKER_BUILDKIT: "1"
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- run: docker build . --build-arg PROXY_UNOPTIMIZED=1

View File

@ -61,16 +61,7 @@ RUN --mount=type=cache,target=target \
## Install the proxy binary into the base runtime image. ## Install the proxy binary into the base runtime image.
FROM $RUNTIME_IMAGE as runtime FROM $RUNTIME_IMAGE as runtime
# When set, causes the proxy to remove the identity wrapper responsible for
# CSR and key generation.
ARG SKIP_IDENTITY_WRAPPER
WORKDIR /linkerd WORKDIR /linkerd
COPY --from=build /out/linkerd2-proxy /usr/lib/linkerd/linkerd2-proxy COPY --from=build /out/linkerd2-proxy /usr/lib/linkerd/linkerd2-proxy
ENV LINKERD2_PROXY_LOG=warn,linkerd=info ENV LINKERD2_PROXY_LOG=warn,linkerd=info
RUN \
if [ -n "$SKIP_IDENTITY_WRAPPER" ] ; then \
rm -f /usr/bin/linkerd2-proxy-run && \
ln /usr/lib/linkerd/linkerd2-proxy /usr/bin/linkerd2-proxy-run ; \
fi
# Inherits the ENTRYPOINT from the runtime image. # Inherits the ENTRYPOINT from the runtime image.