Skip to content

Commit 1c4e1c8

Browse files
committed
common: pin and verify the components
Signed-off-by: Vicente Cheng <vicente.cheng@suse.com>
1 parent 2794b17 commit 1c4e1c8

File tree

5 files changed

+24
-12
lines changed

5 files changed

+24
-12
lines changed

Dockerfile.dapper

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ ARG DAPPER_HOST_ARCH
44
ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH}
55

66
RUN zypper -n rm container-suseconnect && \
7-
zypper -n install git curl docker gzip tar wget awk
7+
zypper -n install git curl docker gzip tar wget awk docker-buildx
88

99
## install golangci
10-
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s latest
11-
12-
# The docker version in dapper is too old to have buildx. Install it manually.
13-
RUN curl -sSfL https://github.com/docker/buildx/releases/download/v0.13.1/buildx-v0.13.1.linux-${ARCH} -o buildx-v0.13.1.linux-${ARCH} && \
14-
chmod +x buildx-v0.13.1.linux-${ARCH} && \
15-
mv buildx-v0.13.1.linux-${ARCH} /usr/local/bin/buildx
10+
COPY --from=golangci/golangci-lint:v2.11.4-alpine@sha256:72bcd68512b4e27540dd3a778a1b7afd45759d8145cfb3c089f1d7af53e718e9 /usr/bin/golangci-lint /usr/local/bin/golangci-lint
1611

1712
## install controller-gen
1813
RUN go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.18.0

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
TARGETS := $(shell ls scripts)
22

3+
SHA512SUM_Linux_aarch64 := 781951b31e5ff018a04e755c6da7163b31a81edda61f1bed4def8d0e24229865c58a3d26aa0cc4184058d91ebcae300ead2cad16d3c46ccb1098419e3e41a016
4+
SHA512SUM_Linux_x86_64 := d2ec27ecf9362e2fafd27d76d85a5c5b92b53aefe07cffa76bf9887db6bee07b1023cca8fc32a2c9bdd2ecfadaee71397066b41bd37c9ebbbbce09913f0884d4
5+
SHA512SUM_Darwin_arm64 := 8a356c89ad32af1698ae8615a6e303773a8ac58b114368454d59965ec2aa8282e780d1e228d37c301ce6f87596f68bfe7f204eb5f4c019c386a58dd94153ddcf
6+
SHA512SUM_Darwin_x86_64 := dbab05de04dda26793f4ae7875d0fba96ee54b0228e192fd40c0b2116ed345b5444047fc2e0c90cb481f28cbe0e0452bcecb268c8d074cd8615eb2f5463c30b6
7+
SHA512SUM_Windows_x86_64 := 807aee2f68b6da35cb0885558f5cbc9a6c8747a56c7a200f0e1fcac9e2fd0da570cbb39e48b3192bd1a71805f2ab38fd19d77faebba97a89e5d9a8b430ee429e
8+
39
.dapper:
410
@echo Downloading dapper
5-
@curl -sL https://releases.rancher.com/dapper/latest/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
11+
@curl -sL https://releases.rancher.com/dapper/v0.6.0/dapper-`uname -s`-`uname -m` > .dapper.tmp
12+
@CHECKSUM=$$(shasum -a 512 .dapper.tmp | awk '{print $$1}'); \
13+
if [ "$$CHECKSUM" != "$(SHA512SUM_$(shell uname -s)_$(shell uname -m))" ]; then \
14+
echo "Checksum verification failed!"; \
15+
exit 1; \
16+
fi
617
@@chmod +x .dapper.tmp
718
@./.dapper.tmp -v
819
@mv .dapper.tmp .dapper

ci/scripts/helpers.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
TOP_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" &> /dev/null && pwd )"
44

5+
HELM_VERSION=v3.20.0
6+
HELM_SUM_amd64=dbb4c8fc8e19d159d1a63dda8db655f9ffa4aac1b9a6b188b34a40957119b286
7+
HELM_SUM_arm64=bfb14953295d5324d47ab55f3dfba6da28d46c848978c8fbf412d4271bdc29f1
8+
HELM_SUM="HELM_SUM_${ARCH}"
9+
510
# ensure helm command
611
if [[ $(ensure_command helm) -eq 1 ]]; then
712
echo "no helm, try to curl..."
8-
curl -O https://get.helm.sh/helm-v3.9.4-linux-amd64.tar.gz
9-
tar -zxvf helm-v3.9.4-linux-amd64.tar.gz
13+
curl -O https://get.helm.sh/helm-${HELM_VERSION}-linux-${ARCH}.tar.gz
14+
echo "${!HELM_SUM}" helm-${HELM_VERSION}-linux-${ARCH}.tar.gz | sha256sum -c -
15+
tar xvzf helm-${HELM_VERSION}-linux-${ARCH}.tar.gz
1016
HELM=$TOP_DIR/linux-amd64/helm
1117
$HELM version
1218
else

scripts/package_controller

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ -e ${DOCKERFILE}.${ARCH} ]; then
1414
DOCKERFILE=${DOCKERFILE}.${ARCH}
1515
fi
1616

17-
buildx build --load -f ${DOCKERFILE} -t ${IMAGE} .
17+
docker buildx build --load -f ${DOCKERFILE} -t ${IMAGE} .
1818
echo Built ${IMAGE}
1919
if [[ -n ${BUILD_FOR_CI} ]]; then
2020
docker push ${IMAGE}

scripts/package_webhook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ -e ${DOCKERFILE}.${ARCH} ]; then
1414
DOCKERFILE=${DOCKERFILE}.${ARCH}
1515
fi
1616

17-
buildx build --load -f ${DOCKERFILE} -t ${IMAGE} .
17+
docker buildx build --load -f ${DOCKERFILE} -t ${IMAGE} .
1818
echo Built ${IMAGE}
1919
if [[ -n ${BUILD_FOR_CI} ]]; then
2020
docker push ${IMAGE}

0 commit comments

Comments
 (0)