Skip to content

Commit

Permalink
fix dashboard build
Browse files Browse the repository at this point in the history
  • Loading branch information
klinch0 committed Dec 3, 2024
1 parent f73a5a0 commit 87c6214
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions packages/system/dashboard/images/kubeapps-apis/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,23 @@

# syntax = docker/dockerfile:1

FROM bitnami/golang:1.23.2 AS builder
FROM alpine as source
ARG VERSION=v2.11.0
RUN apk add --no-cache patch
WORKDIR /source
RUN wget -O- https://github.com/vmware-tanzu/kubeapps/archive/refs/tags/${VERSION}.tar.gz | tar xzf - --strip-components=1
COPY fluxcd.diff /patches/fluxcd.diff
COPY labels.diff /patches/labels.diff
COPY reconcile-strategy.diff /patches/reconcile-strategy.diff
COPY dashboard-resource.diff /patches/dashboard-resource.diff
RUN patch -p1 < /patches/fluxcd.diff
RUN patch -p1 < /patches/labels.diff
RUN patch -p1 < /patches/reconcile-strategy.diff
RUN patch -p1 < /patches/dashboard-resource.diff

FROM bitnami/golang:1.22.5 AS builder
WORKDIR /go/src/github.com/vmware-tanzu/kubeapps
COPY go.mod go.sum ./
COPY --from=source /source/go.mod /source/go.sum ./
ARG VERSION="devel"
ARG TARGETARCH

Expand Down Expand Up @@ -40,8 +54,8 @@ RUN --mount=type=cache,target=/go/pkg/mod \

# We don't copy the pkg and cmd directories until here so the above layers can
# be reused.
COPY pkg pkg
COPY cmd cmd
COPY --from=source /source/pkg pkg
COPY --from=source /source/cmd cmd

RUN if [ ! -z ${lint:-} ]; then \
# Run golangci-lint to detect issues
Expand All @@ -60,15 +74,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
-ldflags "-X github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/cmd.version=$VERSION" \
./cmd/kubeapps-apis

# Build 'kapp-controller' plugin, version 'v1alpha1'
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GOPROXY="https://proxy.golang.org,direct" \
go build \
-ldflags "-X github.com/vmware-tanzu/kubeapps/cmd/kubeapps-apis/cmd.version=$VERSION" \
-o /kapp-controller-packages-v1alpha1-plugin.so -buildmode=plugin \
./cmd/kubeapps-apis/plugins/kapp_controller/packages/v1alpha1/*.go

## Build 'fluxv2' plugin, version 'v1alpha1'
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
Expand Down Expand Up @@ -101,7 +106,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \
FROM bitnami/minideb:bookworm
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/github.com/vmware-tanzu/kubeapps/kubeapps-apis /kubeapps-apis
COPY --from=builder /kapp-controller-packages-v1alpha1-plugin.so /plugins/kapp-controller-packages/
COPY --from=builder /fluxv2-packages-v1alpha1-plugin.so /plugins/fluxv2-packages/
COPY --from=builder /helm-packages-v1alpha1-plugin.so /plugins/helm-packages/
COPY --from=builder /resources-v1alpha1-plugin.so /plugins/resources/
Expand Down

0 comments on commit 87c6214

Please sign in to comment.