@@ -10,34 +10,44 @@ FROM ${IMAGE_LOCATION}
10
10
11
11
LABEL org.opencontainers.image.source="https://github.com/Azure/CloudShell"
12
12
13
+ # ---------------------- Installation same as base image ----------------------
13
14
# Copy and run script to install Powershell modules and setup Powershell machine
14
15
# profile
15
16
COPY ./linux/powershell/ powershell
16
17
17
- RUN tdnf clean all && \
18
- tdnf repolist --refresh && \
19
- ACCEPT_EULA=Y tdnf update -y && \
20
- # Install latest Azure CLI package. CLI team drops latest (pre-release) package here prior to public release
21
- # We don't support using this location elsewhere - it may be removed or updated without notice
22
- wget https://azurecliprod.blob.core.windows.net/cloudshell-release/azure-cli-latest-mariner2.0.rpm \
23
- && tdnf install -y ./azure-cli-latest-mariner2.0.rpm \
24
- && rm azure-cli-latest-mariner2.0.rpm && \
25
- tdnf clean all && \
26
- rm -rf /var/cache/tdnf/* && \
27
- #
28
- # Install any Azure CLI extensions that should be included by default.
29
- az extension add --system --name ai-examples -y && \
30
- az extension add --system --name ssh -y && \
31
- az extension add --system --name ml -y && \
32
- #
33
- # Install kubectl
34
- az aks install-cli && \
35
- #
36
- # Powershell installation and setup
37
- /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Base && \
38
- cp -r ./powershell/PSCloudShellUtility /usr/local/share/powershell/Modules/PSCloudShellUtility/ && \
39
- /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Top && \
40
- # Install Powershell warmup script
41
- mkdir -p linux/powershell && \
42
- cp powershell/Invoke-PreparePowerShell.ps1 linux/powershell/Invoke-PreparePowerShell.ps1 && \
43
- rm -rf ./powershell
18
+ # Install latest Azure CLI package. CLI team drops latest (pre-release) package
19
+ # here prior to public release We don't support using this location elsewhere -
20
+ # it may be removed or updated without notice.
21
+ RUN INSTALLED_VERSION=$(az version --output json 2>/dev/null | jq -r '."azure-cli"' ) && \
22
+ wget https://azurecliprod.blob.core.windows.net/cloudshell-release/azure-cli-latest-mariner2.0.rpm && \
23
+ # Get the version of the downloaded Azure CLI
24
+ DOWNLOADED_VERSION=$(rpm --queryformat="%{VERSION}" -qp ./azure-cli-latest-mariner2.0.rpm) && \
25
+ #
26
+ # If the installed Azure CLI and the downloaded Azure CLI are different, then
27
+ # install the downloaded Azure CLI.
28
+ if [ "$DOWNLOADED_VERSION" != "$INSTALLED_VERSION" ]; then \
29
+ tdnf clean all && \
30
+ tdnf repolist --refresh && \
31
+ ACCEPT_EULA=Y tdnf update -y && \
32
+ tdnf install -y ./azure-cli-latest-mariner2.0.rpm && \
33
+ tdnf clean all && \
34
+ rm -rf /var/cache/tdnf/* && \
35
+ #
36
+ # Install any Azure CLI extensions that should be included by default.
37
+ az extension add --system --name ai-examples -y && \
38
+ az extension add --system --name ssh -y && \
39
+ az extension add --system --name ml -y && \
40
+ #
41
+ # Install kubectl
42
+ az aks install-cli && \
43
+ #
44
+ # Powershell installation and setup
45
+ /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Base && \
46
+ cp -r ./powershell/PSCloudShellUtility /usr/local/share/powershell/Modules/PSCloudShellUtility/ && \
47
+ /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Top && \
48
+ # Install Powershell warmup script
49
+ mkdir -p linux/powershell && \
50
+ cp powershell/Invoke-PreparePowerShell.ps1 linux/powershell/Invoke-PreparePowerShell.ps1; \
51
+ fi && \
52
+ rm azure-cli-latest-mariner2.0.rpm && \
53
+ rm -rf ./powershell
0 commit comments