k3s/tests/terraform/Dockerfile.build
fmoral2 6c394abb32
Add make commands to terraform automation and fix external dbs related issue (#7159)
* test: add make commands and dependencies

Signed-off-by: Francisco <francisco.moral@suse.com>

* fix: fix issue on logic for using external dbs and dependencies

Signed-off-by: Francisco <francisco.moral@suse.com>

---------

Signed-off-by: Francisco <francisco.moral@suse.com>
2023-04-06 12:17:13 -03:00

27 lines
952 B
Docker

FROM golang:alpine
ARG TF_VERSION=1.4.0
ENV TERRAFORM_VERSION $TF_VERSION
RUN apk update && \
apk upgrade --update-cache --available && \
apk add --no-cache curl git jq bash openssh unzip gcc g++ make ca-certificates && \
if [ "$(uname -m)" = "aarch64" ]; then \
KUBE_ARCH="linux/arm64" && \
TF_ARCH="linux_arm64"; \
else \
KUBE_ARCH="linux/amd64" && \
TF_ARCH="linux_amd64"; \
fi && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/${KUBE_ARCH}/kubectl" && \
chmod +x ./kubectl && \
mv ./kubectl /usr/local/bin && \
mkdir tmp && \
curl "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_${TF_ARCH}.zip" -o tmp/terraform.zip && \
unzip tmp/terraform.zip -d /usr/local/bin && \
chmod +x /usr/local/bin/terraform && \
rm -rf tmp
WORKDIR $GOPATH/src/github.com/k3s-io/k3s
COPY . .