This repository has been archived by the owner on Sep 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
57 lines (45 loc) · 1.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM debian:buster-slim
LABEL MAINTAINER="Julie Ng <azure@julie.io>"
ARG AZ_CLI_VERSION=2.14.0-1~buster
ARG AZ_DEVOPS_VERSION=0.18.0
ARG TERRAFORM_VERSION=0.13.5
ARG DEBIAN_FRONTEND=noninteractive
USER root
# Required dependencies
RUN apt-get update -qq && \
apt-get install -y \
apt-transport-https \
build-essential \
ca-certificates \
curl \
gnupg \
libpq-dev \
lsb-release \
nodejs \
software-properties-common
# Install Azure CLI incl. Azure DevOps extension
RUN curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
gpg --dearmor | \
tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | \
tee /etc/apt/sources.list.d/azure-cli.list && \
apt-get update && \
apt-cache policy azure-cli && \
apt-get install azure-cli=${AZ_CLI_VERSION} && \
apt-get install azure-cli --no-upgrade && \
az --version && \
az extension add --name azure-devops --version ${AZ_DEVOPS_VERSION} && \
az extension list -o table
# Install Terraform
RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \
apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
apt-get update && \
apt-cache policy terraform && \
apt-get install terraform=${TERRAFORM_VERSION} && \
apt-get install terraform --no-upgrade && \
terraform -version
# Do not run as root
RUN groupadd --system devops && \
useradd --create-home --system --gid devops devops
USER devops
WORKDIR /home/devops