-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathtools.Dockerfile
More file actions
87 lines (68 loc) · 3.78 KB
/
tools.Dockerfile
File metadata and controls
87 lines (68 loc) · 3.78 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# IMAGE_LOCATION refers to a Microsoft-internal container registry which stores a cached version
# of the image built from base.Dockerfile. If you are building this file outside Microsoft, you
# won't be able to reach this location, but don't worry!
# To build yourself locally, override this location with a local image tag. See README.md for more detail
ARG IMAGE_LOCATION=cdpxb787066ec88f4e20ae65e42a858c42ca00.azurecr.io/official/cloudshell:base.master.f360dc4c.20240510.1
# Copy from base build
FROM ${IMAGE_LOCATION}
LABEL org.opencontainers.image.source="https://github.com/Azure/CloudShell"
RUN tdnf clean all && \
tdnf repolist --refresh && \
ACCEPT_EULA=Y tdnf update -y && \
# Install latest Azure CLI package. CLI team drops latest (pre-release) package here prior to public release
# We don't support using this location elsewhere - it may be removed or updated without notice
wget https://azurecliprod.blob.core.windows.net/cloudshell-release/azure-cli-latest-mariner2.0.rpm \
&& tdnf install -y ./azure-cli-latest-mariner2.0.rpm \
&& rm azure-cli-latest-mariner2.0.rpm && \
tdnf clean all && \
rm -rf /var/cache/tdnf/*
# Install any Azure CLI extensions that should be included by default.
RUN az extension add --system --name ai-examples -y \
&& az extension add --system --name ssh -y \
&& az extension add --system --name ml -y
# Install kubectl
RUN az aks install-cli \
&& chmod +x /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubelogin
# Install vscode
RUN wget -nv -O vscode.tar.gz "https://code.visualstudio.com/sha/download?build=insider&os=cli-alpine-x64" \
&& tar -xvzf vscode.tar.gz \
&& mv ./code-insiders /bin/vscode \
&& rm vscode.tar.gz
# Install azure-developer-cli (azd)
ENV AZD_IN_CLOUDSHELL 1
ENV AZD_SKIP_UPDATE_CHECK 1
RUN curl -fsSL https://aka.ms/install-azd.sh | bash
RUN mkdir -p /usr/cloudshell
WORKDIR /usr/cloudshell
# Install Office 365 CLI templates
RUN npm install -q -g @pnp/cli-microsoft365
# Install Bicep CLI
RUN curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 \
&& chmod +x ./bicep \
&& mv ./bicep /usr/local/bin/bicep \
&& bicep --help
# Temp: fix ansible modules. Proper fix is to update base layer to use regular python for Ansible.
RUN mkdir -p /usr/share/ansible/collections/ansible_collections/azure/azcollection/ \
&& wget -nv -q -O /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements.txt https://raw.githubusercontent.com/ansible-collections/azure/dev/requirements.txt \
&& /opt/ansible/bin/python -m pip install -r /usr/share/ansible/collections/ansible_collections/azure/azcollection/requirements.txt
# Copy and run script to Install powershell modules and setup Powershell machine profile
COPY ./linux/powershell/PSCloudShellUtility/ /usr/local/share/powershell/Modules/PSCloudShellUtility/
COPY ./linux/powershell/ powershell
RUN /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Top && rm -rf ./powershell
# install powershell warmup script
COPY ./linux/powershell/Invoke-PreparePowerShell.ps1 linux/powershell/Invoke-PreparePowerShell.ps1
# Remove su so users don't have su access by default.
RUN rm -f ./linux/Dockerfile && rm -f /bin/su
# cleanup tmp files left behind by installation
RUN find /tmp/ -mindepth 1 -delete
#Add soft links
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN ln -s /usr/bin/node /usr/bin/nodejs
# Add user's home directories to PATH at the front so they can install tools which
# override defaults
# Add dotnet tools to PATH so users can install a tool using dotnet tools and can execute that command from any directory
ENV PATH ~/.local/bin:~/bin:~/.dotnet/tools:$PATH
ENV AZURE_CLIENTS_SHOW_SECRETS_WARNING True
# Set AZUREPS_HOST_ENVIRONMENT
ENV AZUREPS_HOST_ENVIRONMENT cloud-shell/1.0