diff --git a/linux/base.Dockerfile b/linux/base.Dockerfile index 65673673..382a1735 100644 --- a/linux/base.Dockerfile +++ b/linux/base.Dockerfile @@ -184,12 +184,3 @@ RUN gem install bundler --no-document --clear-sources --force \ ENV GEM_HOME=~/bundle ENV BUNDLE_PATH=~/bundle ENV PATH=$PATH:$GEM_HOME/bin:$BUNDLE_PATH/gems/bin - -# PowerShell telemetry -ENV POWERSHELL_DISTRIBUTION_CHANNEL CloudShell -# don't tell users to upgrade, they can't -ENV POWERSHELL_UPDATECHECK Off - -# Copy and run script to Install powershell modules -COPY ./linux/powershell/ powershell -RUN /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Base && rm -rf ./powershell diff --git a/linux/tools.Dockerfile b/linux/tools.Dockerfile index a7466c26..1836f945 100644 --- a/linux/tools.Dockerfile +++ b/linux/tools.Dockerfile @@ -59,13 +59,20 @@ RUN mkdir -p /usr/share/ansible/collections/ansible_collections/azure/azcollecti && 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 +# Powershell telemetry +ENV POWERSHELL_DISTRIBUTION_CHANNEL=CloudShell \ + # don't tell users to upgrade, they can't + POWERSHELL_UPDATECHECK=Off -# install powershell warmup script -COPY ./linux/powershell/Invoke-PreparePowerShell.ps1 linux/powershell/Invoke-PreparePowerShell.ps1 +# Copy and run script to install Powershell modules and setup Powershell machine profile +COPY ./linux/powershell/ powershell +RUN /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Base && \ + cp -r ./powershell/PSCloudShellUtility /usr/local/share/powershell/Modules/PSCloudShellUtility/ && \ + /usr/bin/pwsh -File ./powershell/setupPowerShell.ps1 -image Top && \ + # Install Powershell warmup script + mkdir -p linux/powershell && \ + cp powershell/Invoke-PreparePowerShell.ps1 linux/powershell/Invoke-PreparePowerShell.ps1 && \ + rm -rf ./powershell # Remove su so users don't have su access by default. RUN rm -f ./linux/Dockerfile && rm -f /bin/su