Container based on Ubuntu (latest) Terraform, Ansible, Helm, Azure, AWS, Google Cloud CLIs. Enjoy!
530
Image includes:
- Ubuntu 20.04
- Python 3
- Pip 3
- Utils - unzip gzip curl wget bash-completion git git-lfs jq sshpass ansible apt-utils
- Ansible (latest)
- Helm 3
- Terraform 0.13.2
- OpenShift (pip) - For use with OLM/Operators in kubernetes clusters
- kubectl 1.18.2
- kustomize 3.6.1
- AWS CLI
- aws-iam-authenticator
- Azure CLI
- Google CLI
You can now identify which version of terraform and kustomize you might need when building the image. The code no longer just pulls the latest kustomize using there standard script.
Dockerfile:
FROM golang:1.15 as go_builder
RUN go get github.com/google/go-jsonnet/cmd/jsonnet && go get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb && go get github.com/brancz/gojsontoyaml
FROM ubuntu:20.04 as baseline
# Update baseline OS.
WORKDIR /build
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install python3 python3-dev python3-pip curl unzip
# Adjust python to use only Python 3
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
&& update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Install Terraform
FROM baseline as terraform_builder
ENV version=0.13.2
RUN curl -sLO https://releases.hashicorp.com/terraform/${version}/terraform_${version}_linux_amd64.zip && unzip ./terraform_${version}_linux_amd64.zip
# Install kubectl
FROM baseline as kubectl_builder
ENV version=1.18.2
# RUN curl -sLO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl && chmod 755 ./kubectl
RUN curl -sLO https://storage.googleapis.com/kubernetes-release/release/v{$version}/bin/linux/amd64/kubectl && chmod 755 ./kubectl
# Install Google CLI
FROM baseline as google_cli_builder
RUN curl -s https://sdk.cloud.google.com | bash
# Install kustomize
FROM baseline as kustomize_builder
ENV version=3.6.1
# RUN curl -s https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh | bash
RUN curl -sLO https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v${version}/kustomize_v${version}_linux_amd64.tar.gz && gunzip -c ./kustomize_v${version}_linux_amd64.tar.gz | tar xvf - && chmod 755 ./kustomize
# Installation
FROM baseline
# Change working dir to /cloud/clis
WORKDIR /cloud/clis
# Add extra packages
RUN apt-get -y install gzip wget bash-completion git git-lfs jq sshpass ansible apt-utils tree vim nano
# Install tooling
RUN curl -s https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash \
&& pip install openshift \
&& curl -sLO https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip && unzip awscli-exe-linux-x86_64.zip && ./aws/install && rm -rf awscli-exe-linux-x86_64.zip \
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash \
&& curl -so aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.9/2020-08-04/bin/linux/amd64/aws-iam-authenticator && chmod 755 aws-iam-authenticator && mv aws-iam-authenticator /usr/local/bin/aws-iam-authenticator \
&& echo 'source /etc/profile.d/bash_completion.sh\nsource <(kubectl completion bash)\nalias k=kubectl\ncomplete -F __start_kubectl k' >> ~/.bashrc \
&& echo 'source /cloud/clis/google-cloud-sdk/completion.bash.inc' >> ~/.bashrc \
&& echo 'source /cloud/clis/google-cloud-sdk/path.bash.inc' >> ~/.bashrc
# Copy items from 'build' images above
COPY --from=go_builder /go/bin/jsonnet /usr/local/bin/jsonnet
COPY --from=go_builder /go/bin/jb /usr/local/bin/jb
COPY --from=go_builder /go/bin/gojsontoyaml /usr/local/bin/gojsontoyaml
COPY --from=terraform_builder /build/terraform /usr/local/bin/terraform
COPY --from=kubectl_builder /build/kubectl /usr/local/bin/kubectl
COPY --from=kustomize_builder /build/kustomize /usr/local/bin/kustomize
COPY --from=google_cli_builder /root/google-cloud-sdk /cloud/clis/google-cloud-sdk
# Change working dir back to /bastion
WORKDIR /bastion
Running:
cd <Project root directory>
docker run --hostname=ubuntu-bastion -it --rm -v `pwd`:/bastion thpang/ubuntu-bastion:latest bash
You can also run mounting your .ssh and .kube directories for use with your ssh keys, kube configs for use with kubectl and git like this:
docker run --hostname=ubuntu-bastion -it --rm -v $HOME/.ssh:/root/.ssh -v $HOME/.kube:/root/.kube -v $HOME:/bastion thpang/ubuntu-bastion:latest bash
Content type
Image
Digest
Size
599.7 MB
Last updated
about 6 years ago
docker pull thpang/ubuntu-bastion