Skip to content

Instantly share code, notes, and snippets.

@maximivanov
Last active February 1, 2021 13:10
Show Gist options
  • Save maximivanov/a8d61269e047872fe9cc86128e8101ea to your computer and use it in GitHub Desktop.
Save maximivanov/a8d61269e047872fe9cc86128e8101ea to your computer and use it in GitHub Desktop.
Utility Docker image to develop and deploy Azure Functions in Node.js with Terraform. zsh, ohmyzsh, powerlevel10k.
# Usage
# docker build -t maxivanov/az-dev-img - < Dockerfile
# docker run -it --rm maxivanov/az-dev-img
#
# az --version
# func --version
# node --version
# npm --version
# terraform --version
FROM node:14
WORKDIR /var/downloads
RUN apt-get update && \
apt-get install -y \
# fix "add-apt-repository: command not found"
ca-certificates \
# fix "apt-add-repository: not found"
software-properties-common \
zsh
# https://github.com/ohmyzsh/ohmyzsh
# https://github.com/romkatv/powerlevel10k#manual
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k && \
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc && \
echo 'source ~/.p10k.zsh' >>~/.zshrc
# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
# https://github.com/Azure/azure-functions-core-tools#v3-1
RUN npm i -g azure-functions-core-tools@3 --unsafe-perm true
# https://www.terraform.io/docs/cli/install/apt.html
RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \
apt-add-repository "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
apt update && \
apt install terraform
# https://www.terraform.io/downloads.html
# RUN wget https://releases.hashicorp.com/terraform/0.14.3/terraform_0.14.3_linux_amd64.zip && \
# unzip -d terraform terraform_0.14.3_linux_amd64.zip && rm terraform_0.14.3_linux_amd64.zip && \
# mv terraform/terraform /usr/local/bin/ && \
# rm -rf terraform
# https://terragrunt.gruntwork.io/docs/getting-started/install/
RUN wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.27.1/terragrunt_linux_amd64 && \
chmod u+x terragrunt_linux_amd64 && \
mv terragrunt_linux_amd64 /usr/local/bin/terragrunt
WORKDIR /var/app
CMD [ "zsh" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment