Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build) make distroless default Docker target #3043

Merged
merged 1 commit into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ Adding a new version? You'll need three changes:
reference, the listener ResolvedRefs condition reason is set to
RefNotPermitted.
[#3024](https://github.com/Kong/kubernetes-ingress-controller/pull/3024)
- The `distroless` target is now the last target in the Dockerfile. This makes
it the default target if `docker buildx build` is invoked without a target.
While custom image build pipelines _should_ specify a target, this change
makes the default the same target released as the standard
`kong/kubernetes-ingress-controller:X.Y.Z` tags in the official repo.
[#3043](https://github.com/Kong/kubernetes-ingress-controller/pull/3043)

## [2.7.0]

Expand Down
46 changes: 23 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,6 @@ USER 65532:65532
ENTRYPOINT ["/go/bin/dlv"]
CMD ["exec", "--continue", "--accept-multiclient", "--headless", "--api-version=2", "--listen=:2345", "--log", "/workspace/manager-debug"]

### Distroless/default
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot AS distroless
ARG TAG
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH

LABEL name="Kong Ingress Controller" \
vendor="Kong" \
version="$TAG" \
release="1" \
url="https://github.com/Kong/kubernetes-ingress-controller" \
summary="Kong for Kubernetes Ingress" \
description="Use Kong for Kubernetes Ingress. Configure plugins, health checking, load balancing and more in Kong for Kubernetes Services, all using Custom Resource Definitions (CRDs) and Kubernetes-native tooling."

WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532

ENTRYPOINT ["/manager"]

### RHEL
# Build UBI image
FROM registry.access.redhat.com/ubi8/ubi AS redhat
Expand Down Expand Up @@ -171,3 +148,26 @@ USER 1000

# Run the compiled binary.
ENTRYPOINT ["/manager"]

### Distroless/default
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot AS distroless
ARG TAG
ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH

LABEL name="Kong Ingress Controller" \
vendor="Kong" \
version="$TAG" \
release="1" \
url="https://github.com/Kong/kubernetes-ingress-controller" \
summary="Kong for Kubernetes Ingress" \
description="Use Kong for Kubernetes Ingress. Configure plugins, health checking, load balancing and more in Kong for Kubernetes Services, all using Custom Resource Definitions (CRDs) and Kubernetes-native tooling."

WORKDIR /
COPY --from=builder /workspace/manager .
USER 65532:65532

ENTRYPOINT ["/manager"]