forked from k3s-io/k3s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.test
36 lines (25 loc) · 1.14 KB
/
Dockerfile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ARG GOLANG=golang:1.19.5-alpine3.17
FROM ${GOLANG} as test-base
RUN apk -U --no-cache add bash jq
ENV K3S_SOURCE /go/src/github.com/k3s-io/k3s/
WORKDIR ${K3S_SOURCE}
COPY . ${K3S_SOURCE}
FROM test-base as test-mods
COPY ./scripts/test-mods /bin/
ENTRYPOINT ["/bin/test-mods"]
FROM test-base as test-k3s
RUN apk -U --no-cache add git gcc musl-dev docker curl coreutils python3 openssl py3-pip procps findutils
RUN python3 -m pip install awscli
ENV SONOBUOY_VERSION 0.56.14
RUN OS=linux; \
ARCH=$(go env GOARCH); \
RELEASE=$(curl -fs https://storage.googleapis.com/kubernetes-release/release/stable.txt); \
if [ "${ARCH}" == "amd64" ] || [ "${ARCH}" == "arm64" ] || [ "${ARCH}" == "s390x" ]; then \
curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${SONOBUOY_VERSION}/sonobuoy_${SONOBUOY_VERSION}_${OS}_${ARCH}.tar.gz" | \
tar -xzf - -C /usr/local/bin; \
fi; \
curl -fsL https://storage.googleapis.com/kubernetes-release/release/${RELEASE}/bin/linux/${ARCH}/kubectl -o /usr/local/bin/kubectl; \
chmod a+x /usr/local/bin/kubectl;
ENV TEST_CLEANUP true
ENTRYPOINT ["./scripts/entry.sh"]
CMD ["test"]