forked from libre-devops/azure-terraform-gh-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Base.Dockerfile
61 lines (49 loc) · 2.29 KB
/
Base.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
58
59
60
61
#Use supplier image
FROM docker.io/ubuntu:focal
LABEL org.opencontainers.image.source=https://github.com/libre-devops/azure-function-app-deployment-gh-action
ARG DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive
#Declare user expectation, I am performing root actions, so use root.
USER root
#Install needed packages as well as setup python with args and pip
RUN apt-get update -y && apt-get dist-upgrade -y && apt-get install -y \
apt-transport-https \
bash \
ca-certificates \
curl \
gcc \
git \
sudo \
software-properties-common \
unzip \
wget \
zip \
zlib1g-dev && \
useradd -m -s /bin/bash linuxbrew && \
usermod -aG sudo linuxbrew && \
mkdir -p /home/linuxbrew/.linuxbrew && \
chown -R linuxbrew: /home/linuxbrew/.linuxbrew && \
wget -q https://packages.microsoft.com/config/ubuntu/$(grep -oP '(?<=^DISTRIB_RELEASE=).+' /etc/lsb-release | tr -d '"')/packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y powershell && \
apt-get install -y dotnet-sdk-6.0 && \
echo 'alias powershell="pwsh"' >> "${HOME}/.bashrc"
RUN pwsh -Command Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
RUN pwsh -Command Install-Module -Name Az -Force -AllowClobber
#Set User Path with expected paths for new packages
ENV PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/usr/local/go:/usr/local/go/dev/bin:/usr/local/bin/python3:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.local/bin:${PATH}"
RUN echo $PATH | tee /etc/environment
USER linuxbrew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && \
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/linuxbrew/.bash_profile && \
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/linuxbrew/.bashrc && \
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" && \
echo 'alias powershell="pwsh"' >> /home/linuxbrew/.bashrc
RUN brew install python3 node openjdk go rust tree
RUN pip3 install azure-cli
RUN brew install gcc && \
brew tap azure/functions && \
brew install azure-functions-core-tools
USER root
WORKDIR /