Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Commit d461248

Browse files
authored
Improve kubeapps-apis dockerfile and docs (#6589)
### Description of the change Just a minor PR mainly sorting the `ARG`s and adding some comments to make it easier to find the latest release. Also, making the download of golangci-lint conditional. Finally, adding `GRPC_HEALTH_PROBE_VERSION` to the docs, so that we can find it easily. ### Benefits More clear dockerfile ### Possible drawbacks N/A ### Applicable issues N/A ### Additional information N/A Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
1 parent 4cd610c commit d461248

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

cmd/kubeapps-apis/Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,27 @@ WORKDIR /go/src/github.com/vmware-tanzu/kubeapps
88
COPY go.mod go.sum ./
99
ARG VERSION="devel"
1010

11+
# If true, run golangci-lint to detect issues
12+
ARG lint
13+
14+
# https://github.com/bufbuild/buf/releases/
1115
ARG BUF_VERSION="1.25.1"
16+
17+
# https://github.com/golangci/golangci-lint/releases
1218
ARG GOLANGCILINT_VERSION="1.53.3"
1319

20+
# https://github.com/grpc-ecosystem/grpc-health-probe/releases/
21+
ARG GRPC_HEALTH_PROBE_VERSION="0.4.19"
22+
1423
# Install lint tools
24+
RUN if [ ! -z "$lint" ]; then \
25+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCILINT_VERSION; \
26+
fi
27+
1528
RUN curl -sSL "https://github.com/bufbuild/buf/releases/download/v$BUF_VERSION/buf-Linux-x86_64" -o "/tmp/buf" && chmod +x "/tmp/buf"
16-
RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$GOLANGCILINT_VERSION
29+
30+
# TODO: Remove and instead use built-in gRPC container probes once we're supporting >= 1.24 only. https://kubernetes.io/blog/2022/05/13/grpc-probes-now-in-beta/
31+
RUN curl -sSL "https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64" -o "/bin/grpc_health_probe" && chmod +x "/bin/grpc_health_probe"
1732

1833

1934
# With the trick below, Go's build cache is kept between builds.
@@ -27,13 +42,10 @@ RUN --mount=type=cache,target=/go/pkg/mod \
2742
COPY pkg pkg
2843
COPY cmd cmd
2944

30-
# If true, run golangci-lint to detect issues
31-
ARG lint
32-
3345
RUN if [ ! -z "$lint" ]; then \
3446
# Run golangci-lint to detect issues
35-
golangci-lint run --timeout=10m ./cmd/kubeapps-apis/... && \
36-
golangci-lint run --timeout=10m ./pkg/...; \
47+
golangci-lint run --timeout=10m ./cmd/kubeapps-apis/... && \
48+
golangci-lint run --timeout=10m ./pkg/...; \
3749
fi
3850

3951
# Lint the proto files to detect errors at build time
@@ -78,11 +90,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
7890
-o /resources-v1alpha1-plugin.so -buildmode=plugin \
7991
./cmd/kubeapps-apis/plugins/resources/v1alpha1/*.go
8092

81-
# Remove and instead use built-in gRPC container probes once we're
82-
# supporting >= 1.24 only. https://kubernetes.io/blog/2022/05/13/grpc-probes-now-in-beta/
83-
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.18 && \
84-
curl -sSL "https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64" -o "/bin/grpc_health_probe" && chmod +x "/bin/grpc_health_probe"
85-
8693
# Note: unlike the other docker images for go, we cannot use scratch as the plugins
8794
# are loaded using the dynamic linker.
8895
FROM bitnami/minideb:bookworm

site/content/docs/latest/reference/developer/release-process.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ For building the [development container images](https://hub.docker.com/u/kubeapp
2222
- [pinniped-proxy/Dockerfile](https://github.com/vmware-tanzu/kubeapps/blob/main/cmd/pinniped-proxy/Dockerfile)
2323
- [oci-catalog/Dockerfile](https://github.com/vmware-tanzu/kubeapps/blob/main/cmd/oci-catalog/Dockerfile)
2424

25-
In some images, some build-time linters are used (e.g., `buf` linter, `gosec` or `golangci-lint` checkers, etc.). When updating the base container image, these linters (like `BUF_VERSION`, `GOLANGCILINT_VERSION`) _should_ be updated to the latest minor/patch version.
25+
In some images, some build-time linters or tools are used (e.g., `buf` linter, `gosec` or `golangci-lint` checkers,`grpc-health-probe`, etc.).
26+
When updating the base container image, these tools (like `BUF_VERSION`, `GOLANGCILINT_VERSION`, `GRPC_HEALTH_PROBE_VERSION`) _should_ be updated to the latest minor/patch version.
2627

2728
> As part of this release process, these image tags _must_ be updated to the latest minor/patch version. In case of a major version, the change _should_ be tracked in a separate PR.
2829
> **Note**: as the official container images are those being created by Bitnami, we _should_ ensure that we are using the same major version as they are using.

0 commit comments

Comments
 (0)