2024-05-06 16:42:27 +00:00
|
|
|
ARG GOLANG=golang:1.22.2-alpine3.18
|
2022-07-08 20:01:12 +00:00
|
|
|
FROM ${GOLANG} as test-base
|
2019-04-29 20:54:51 +00:00
|
|
|
|
2022-07-08 20:01:12 +00:00
|
|
|
RUN apk -U --no-cache add bash jq
|
|
|
|
ENV K3S_SOURCE /go/src/github.com/k3s-io/k3s/
|
|
|
|
WORKDIR ${K3S_SOURCE}
|
|
|
|
|
|
|
|
COPY . ${K3S_SOURCE}
|
|
|
|
|
2023-01-13 18:30:50 +00:00
|
|
|
FROM test-base as test-mods
|
2022-07-08 20:01:12 +00:00
|
|
|
|
|
|
|
COPY ./scripts/test-mods /bin/
|
|
|
|
ENTRYPOINT ["/bin/test-mods"]
|
|
|
|
|
2023-01-13 18:30:50 +00:00
|
|
|
FROM test-base as test-k3s
|
2022-07-08 20:01:12 +00:00
|
|
|
|
2023-12-14 00:44:58 +00:00
|
|
|
RUN apk -U --no-cache add git gcc musl-dev docker curl coreutils python3 openssl py3-pip procps findutils yq
|
2019-04-29 20:54:51 +00:00
|
|
|
|
2023-01-13 18:30:50 +00:00
|
|
|
RUN python3 -m pip install awscli
|
|
|
|
|
2024-01-02 15:59:39 +00:00
|
|
|
ENV SONOBUOY_VERSION 0.57.1
|
2019-04-29 20:54:51 +00:00
|
|
|
|
2020-11-17 20:21:12 +00:00
|
|
|
RUN OS=linux; \
|
|
|
|
ARCH=$(go env GOARCH); \
|
|
|
|
RELEASE=$(curl -fs https://storage.googleapis.com/kubernetes-release/release/stable.txt); \
|
2022-04-15 16:41:40 +00:00
|
|
|
if [ "${ARCH}" == "amd64" ] || [ "${ARCH}" == "arm64" ] || [ "${ARCH}" == "s390x" ]; then \
|
2020-11-17 20:21:12 +00:00
|
|
|
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; \
|
2023-01-12 00:23:29 +00:00
|
|
|
chmod a+x /usr/local/bin/kubectl;
|
2019-04-29 20:54:51 +00:00
|
|
|
|
2019-11-01 16:48:28 +00:00
|
|
|
ENV TEST_CLEANUP true
|
|
|
|
|
2019-04-29 20:54:51 +00:00
|
|
|
ENTRYPOINT ["./scripts/entry.sh"]
|
2022-09-16 18:41:04 +00:00
|
|
|
CMD ["test"]
|
2023-03-11 03:53:41 +00:00
|
|
|
|
|
|
|
|
2023-05-31 20:48:55 +00:00
|
|
|
FROM vagrantlibvirt/vagrant-libvirt:0.12.1 AS test-e2e
|
2023-03-11 03:53:41 +00:00
|
|
|
RUN apt-get update && apt-get install -y docker.io
|
2023-05-31 20:48:55 +00:00
|
|
|
ENV VAGRANT_DISABLE_STRICT_DEPENDENCY_ENFORCEMENT=1
|
2023-03-11 03:53:41 +00:00
|
|
|
RUN vagrant plugin install vagrant-k3s vagrant-reload vagrant-scp
|
2024-02-16 20:30:12 +00:00
|
|
|
RUN vagrant box add generic/ubuntu2204 --provider libvirt --force
|
2023-03-11 03:53:41 +00:00
|
|
|
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"; \
|
|
|
|
chmod +x ./kubectl; \
|
|
|
|
mv ./kubectl /usr/local/bin/kubectl
|
2023-12-19 03:14:02 +00:00
|
|
|
RUN GO_VERSION=go1.21.5; \
|
2023-06-05 21:15:17 +00:00
|
|
|
curl -O -L "https://golang.org/dl/${GO_VERSION}.linux-amd64.tar.gz"; \
|
2023-03-11 03:53:41 +00:00
|
|
|
rm -rf /usr/local/go; \
|
2023-06-05 21:15:17 +00:00
|
|
|
tar -C /usr/local -xzf ${GO_VERSION}.linux-amd64.tar.gz;
|
2023-03-11 03:53:41 +00:00
|
|
|
|
|
|
|
ENV PATH="${PATH}:/usr/local/go/bin"
|
|
|
|
|
|
|
|
|