Skip to content

Commit

Permalink
feat: update container to improve UX experience
Browse files Browse the repository at this point in the history
  • Loading branch information
lambdaclan committed May 14, 2024
1 parent 34325a0 commit 814ab6b
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions toolboxes/powershell-toolbox/Containerfile.powershell
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,30 @@ LABEL com.github.containers.toolbox="true" \
usage="This image is meant to be used with the toolbox or distrobox command" \
description="A container image with integrated Powershell and Microsoft tooling for development environments."

ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1

# COPY ./toolboxes/powershell-toolbox/packages.powershell /tmp
COPY packages.powershell /tmp
# COPY ./toolboxes/powershell-toolbox/profile.ps1 /tmp/Microsoft.PowerShell_profile.ps1
COPY profile.ps1 /tmp/Microsoft.PowerShell_profile.ps1

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]

RUN apk upgrade && \
grep -v '^#' /tmp/packages.powershell | xargs apk add --no-cache
RUN apk upgrade \
&& grep -v '^#' /tmp/packages.powershell | xargs apk add --no-cache \
&& dotnet tool install --global PowerShell \
&& az config set core.collect_telemetry=no \
&& curl -s https://ohmyposh.dev/install.sh | bash -s \
&& curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sh -s -- --git cantino/mcfly \
&& mkdir -p ~/.config/powershell \
&& cp /tmp/Microsoft.PowerShell_profile.ps1 ~/.config/powershell \
&& mkdir -p ~/.local/share/powershell/PSReadLine \
&& touch ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt \
&& rm -rf /tmp/*

ENV DOTNET_TOOLS=~/.dotnet/tools
ENV PATH=${DOTNET_TOOLS}:${PATH}

ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1

RUN az config set core.collect_telemetry=no && \
rm -rf /tmp/*

0 comments on commit 814ab6b

Please sign in to comment.