Skip to content

Commit bc78edb

Browse files
committed
migrate to chainguard image
1 parent 7a6291e commit bc78edb

4 files changed

Lines changed: 1082 additions & 18 deletions

File tree

ci/Containerfile.helm

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
FROM registry.access.redhat.com/ubi9:9.5-1745854298
1+
FROM cgr.dev/chainguard/bash:latest AS base
22

3-
ARG HELM_PACKAGE=https://get.helm.sh/helm-v3.18.4-linux-amd64.tar.gz
4-
ARG HELM_UNITTEST_PACKAGE=https://github.com/helm-unittest/helm-unittest/releases/download/v0.7.0/helm-unittest-linux-amd64-0.7.0.tgz
5-
ARG YQ_PACKAGE=https://github.com/mikefarah/yq/releases/download/v4.44.6/yq_linux_amd64.tar.gz
3+
ARG HELM_UNITTEST_PACKAGE=https://github.com/helm-unittest/helm-unittest/releases/download/v1.0.1/helm-unittest-linux-amd64-1.0.1.tgz
4+
ARG YQ_PACKAGE=https://github.com/mikefarah/yq/releases/download/v4.47.2/yq_linux_amd64.tar.gz
65

76
# Environment variables
87
ENV \
98
HOME="/helm"
109

1110
RUN \
12-
# install Helm
13-
curl ${HELM_PACKAGE} -L -o /tmp/helm.tar.gz && \
14-
tar xvfz /tmp/helm.tar.gz -C /tmp && \
15-
cp -a /tmp/linux-amd64/helm /usr/local/bin/helm && \
16-
rm -rf /tmp/helm.tar.gz /tmp/linux-amd64 && \
1711
# Install Helm unittest plugin
18-
mkdir -p /tmp/hut && \
12+
mkdir -p /tmp/hut /usr/local/bin && \
1913
curl ${HELM_UNITTEST_PACKAGE} -L -o /tmp/helm-unittest.tgz && \
2014
tar xvfz /tmp/helm-unittest.tgz -C /tmp/hut && \
2115
cp /tmp/hut/untt /usr/local/bin/helm-unittest && \
@@ -29,12 +23,12 @@ RUN \
2923
# make all binaries executable
3024
chmod +x /usr/local/bin/*
3125

32-
WORKDIR /helm
26+
RUN ls -al /usr/local/bin
27+
28+
FROM cgr.dev/chainguard/helm:latest-dev AS prod
3329

34-
RUN chown -R 1001:0 /helm && \
35-
chmod -R g=u /helm
30+
COPY --from=base /usr/local/bin/ /usr/local/bin/
3631

37-
USER 1001
32+
WORKDIR /helm
3833

39-
ENTRYPOINT ["/usr/local/bin/helm"]
40-
CMD ["--help"]
34+
USER 65532

helm/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"strings"
1515
)
1616

17-
const HELM_IMAGE string = "quay.io/puzzle/dagger-module-helm:latest"
17+
const HELM_IMAGE string = "harbor.puzzle.ch/pitc-cicd-public/helm-chainguard:latest"
1818

1919
type Helm struct{}
2020

@@ -113,7 +113,7 @@ func (h *Helm) PackagePush(
113113

114114
fmt.Fprintf(os.Stdout, "☸️ Helm package and Push")
115115
c := dag.Container().
116-
From("harbor.puzzle.ch/pitc-cicd-public/alpine-base:latest").
116+
From(HELM_IMAGE).
117117
WithDirectory("/helm", directory).
118118
WithWorkdir("/helm")
119119
version, err := c.WithExec([]string{"sh", "-c", "helm show chart . | yq eval '.version' -"}).Stdout(ctx)

scan-chainguard

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Report Summary
3+
4+
┌───────────────────────────────────────────────────────────────────────────┬──────────┬─────────────────┬─────────┐
5+
│ Target │ Type │ Vulnerabilities │ Secrets │
6+
├───────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┼─────────┤
7+
│ harbor.puzzle.ch/pitc-cicd-public/helm-chainguard:latest (wolfi 20230201) │ wolfi │ 0 │ - │
8+
├───────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┼─────────┤
9+
│ usr/local/bin/helm-unittest │ gobinary │ 0 │ - │
10+
├───────────────────────────────────────────────────────────────────────────┼──────────┼─────────────────┼─────────┤
11+
│ usr/local/bin/yq │ gobinary │ 0 │ - │
12+
└───────────────────────────────────────────────────────────────────────────┴──────────┴─────────────────┴─────────┘
13+
Legend:
14+
- '-': Not scanned
15+
- '0': Clean (no security findings detected)
16+

0 commit comments

Comments
 (0)