# BASE_DISTRIBUTION is used to switch between the old base distribution and distroless base imagesARGBASE_DISTRIBUTION=debug
# Version is the base image version from the TLD MakefileARGBASE_VERSION=latest
ARGISTIO_BASE_REGISTRY=gcr.io/istio-release# The following section is used as base image if BASE_DISTRIBUTION=debugFROM ${ISTIO_BASE_REGISTRY}/base:${BASE_VERSION} as debug# The following section is used as base image if BASE_DISTRIBUTION=distrolessFROM ${ISTIO_BASE_REGISTRY}/distroless:${BASE_VERSION} as distroless# Add dlvFROM golang:1.20 AS build-dlvENVGOPROXY=https://goproxy.io,directRUN go install github.com/go-delve/delve/cmd/dlv@latest# This will build the final image based on either debug or distroless from above# hadolint ignore=DL3006FROM ${BASE_DISTRIBUTION:-debug}ARG TARGETARCHCOPY${TARGETARCH:-amd64}/pilot-discovery /usr/local/bin/pilot-discovery# Copy templates for bootstrap generation.COPY envoy_bootstrap.json /var/lib/istio/envoy/envoy_bootstrap_tmpl.jsonCOPY gcp_envoy_bootstrap.json /var/lib/istio/envoy/gcp_envoy_bootstrap_tmpl.jsonCOPY --from=build-dlv /go/bin/dlv /USER 1337:1337ENTRYPOINT["/dlv","--listen=:1234","--headless=true","--api-version=2","--accept-multiclient","exec","/usr/local/bin/pilot-discovery","--"]#ENTRYPOINT ["/usr/local/bin/pilot-discovery"]