Skip to content

Instantly share code, notes, and snippets.

@invad0r
Created August 26, 2020 06:12
Show Gist options
  • Save invad0r/88d0727fc550c9f5c23fe2156776282e to your computer and use it in GitHub Desktop.
Save invad0r/88d0727fc550c9f5c23fe2156776282e to your computer and use it in GitHub Desktop.
template Dockerfile for interactive use
ARG TAG
FROM hashicorp/terraform:$TAG
RUN apk add --no-cache bash jq openssl graphviz docker python3 \
&& python3 -m ensurepip \
&& rm -r /usr/lib/python*/ensurepip \
&& pip3 install --upgrade pip setuptools \
&& if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi \
&& if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi \
&& rm -r /root/.cache \
&& pip install 'docker-compose==1.23.2' \
&& touch $HOME/.bashrc \
&& terraform -install-autocomplete
WORKDIR /opt/terraform
ENV PS1="[\[\e[35m\]terraform ($(terraform workspace show))\[\e[m\]] \w \$ "
ENTRYPOINT ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment