2023-02-13 16:48:20 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2018-09-03 15:42:25 +00:00
|
|
|
# This Dockerfile installs all the dependencies necessary to run the unit and
|
2018-08-20 22:26:37 +00:00
|
|
|
# acceptance tests. This image also contains gcloud so you can run tests
|
|
|
|
# against a GKE cluster easily.
|
|
|
|
#
|
|
|
|
# This image has no automatic entrypoint. It is expected that you'll run
|
|
|
|
# a script to configure kubectl, potentially install Helm, and run the tests
|
|
|
|
# manually. This image only has the dependencies pre-installed.
|
|
|
|
|
2020-11-24 00:47:25 +00:00
|
|
|
FROM docker.mirror.hashicorp.services/alpine:latest
|
2018-08-20 22:26:37 +00:00
|
|
|
WORKDIR /root
|
|
|
|
|
2021-04-14 17:05:38 +00:00
|
|
|
ENV BATS_VERSION "1.3.0"
|
2020-05-27 16:21:16 +00:00
|
|
|
ENV TERRAFORM_VERSION "0.12.10"
|
2018-08-20 22:26:37 +00:00
|
|
|
|
|
|
|
# base packages
|
|
|
|
RUN apk update && apk add --no-cache --virtual .build-deps \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
tar \
|
|
|
|
bash \
|
|
|
|
openssl \
|
2018-09-03 15:42:25 +00:00
|
|
|
py-pip \
|
2018-08-21 17:51:40 +00:00
|
|
|
git \
|
2020-05-27 16:21:16 +00:00
|
|
|
make \
|
2018-08-21 17:51:40 +00:00
|
|
|
jq
|
2018-08-20 22:26:37 +00:00
|
|
|
|
2018-09-03 15:42:25 +00:00
|
|
|
# yq
|
2024-03-18 18:03:56 +00:00
|
|
|
RUN python3 -m venv venv && \
|
|
|
|
. venv/bin/activate && \
|
|
|
|
pip install yq && \
|
|
|
|
ln -s $PWD/venv/bin/yq /usr/local/bin/yq && \
|
|
|
|
deactivate
|
2018-09-03 15:42:25 +00:00
|
|
|
|
2018-08-20 22:26:37 +00:00
|
|
|
# gcloud
|
|
|
|
RUN curl -OL https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash && \
|
|
|
|
bash install_google_cloud_sdk.bash --disable-prompts --install-dir='/root/' && \
|
|
|
|
ln -s /root/google-cloud-sdk/bin/gcloud /usr/local/bin/gcloud
|
|
|
|
|
2020-05-27 16:21:16 +00:00
|
|
|
# terraform
|
|
|
|
RUN curl -sSL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o /tmp/tf.zip \
|
|
|
|
&& unzip /tmp/tf.zip \
|
|
|
|
&& ln -s /root/terraform /usr/local/bin/terraform
|
|
|
|
|
2018-08-20 22:26:37 +00:00
|
|
|
# kubectl
|
|
|
|
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && \
|
|
|
|
chmod +x ./kubectl && \
|
|
|
|
mv ./kubectl /usr/local/bin/kubectl
|
|
|
|
|
|
|
|
# helm
|
2020-02-06 16:44:38 +00:00
|
|
|
RUN curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
|
2018-08-20 22:26:37 +00:00
|
|
|
|
|
|
|
# bats
|
|
|
|
RUN curl -sSL https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz -o /tmp/bats.tgz \
|
|
|
|
&& tar -zxf /tmp/bats.tgz -C /tmp \
|
|
|
|
&& /bin/bash /tmp/bats-core-$BATS_VERSION/install.sh /usr/local
|