Skip to content

Commit

Permalink
fix: powershell paths and proper locale
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles committed May 18, 2024
1 parent 25d8692 commit e512268
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
12 changes: 8 additions & 4 deletions toolboxes/bluefin-cli/Containerfile.bluefin-cli
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ RUN apk update && \
mv /home/linuxbrew /home/homebrew && \
rm /toolbox-packages

# Use and configure bash, retrieve bash-prexec
# Configure Locales and get bash-prexec
RUN curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o /tmp/bash-prexec && \
mkdir -p /usr/share/ && \
cp /tmp/bash-prexec /usr/share/bash-prexec && \
rm -rf /tmp/*
&& mkdir -p /usr/share/ \
&& cp /tmp/bash-prexec /usr/share/bash-prexec \
&& printf 'LANG=en_US.utf8\nexport LANG\n' > /etc/profile.d/locale.sh \
&& printf 'LANG=en_US.utf8\nexport LANG\n' >> /etc/zsh/zlogin \
&& printf 'if status is-login\n\tset -gx LANG en_US.utf8\nend\n' >> /etc/fish/config.fish \
&& printf 'LANG="en_US.UTF-8"' > /etc/locale.conf \
&& rm -rf /tmp/*
2 changes: 2 additions & 0 deletions toolboxes/bluefin-cli/packages.bluefin-cli
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
atuin
bat
brew
delta
gawk
glibc-locale-en
eza
fd
fish
Expand Down
29 changes: 16 additions & 13 deletions toolboxes/powershell-toolbox/Containerfile.powershell
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# hadolint ignore=DL3007
FROM ghcr.io/ublue-os/wolfi-base:latest
FROM ghcr.io/ublue-os/wolfi-toolbox:latest

LABEL com.github.containers.toolbox="true" \
name="powershell-toolbox" \
Expand All @@ -9,12 +9,10 @@ LABEL com.github.containers.toolbox="true" \
ENV POWERSHELL_TELEMETRY_OPTOUT=1
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1

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

SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
# COPY packages.powershell /tmp
# COPY profile.ps1 /tmp
COPY ./toolboxes/powershell-toolbox/packages.powershell /tmp
COPY ./toolboxes/powershell-toolbox/profile.ps1 /tmp

RUN apk upgrade \
&& grep -v '^#' /tmp/packages.powershell | xargs apk add --no-cache \
Expand All @@ -23,12 +21,17 @@ RUN apk upgrade \
&& curl -s https://ohmyposh.dev/install.sh | bash -s -- -t /usr/local/share/oh-my-posh/themes \
&& curl -LSfs https://raw.githubusercontent.com/cantino/mcfly/master/ci/install.sh | sh -s -- --git cantino/mcfly \
&& cp /tmp/profile.ps1 "$(~/.dotnet/tools/pwsh -Command "\$PROFILE.AllUsersAllHosts")" \
&& mkdir -p ~/.local/share/powershell/PSReadLine \
&& touch ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt \
&& echo 'if test ! -f ${XDG_DATA_HOME:-${HOME}/.local/share}/powershell/PSReadLine/ConsoleHost_history.txt; then mkdir -p ${XDG_DATA_HOME:-${HOME}/.local/share}/powershell/PSReadLine/ && touch ${XDG_DATA_HOME:-${HOME}/.local/share}/powershell/PSReadLine/ConsoleHost_history.txt; fi' > /etc/profile.d/mcfly-history.sh \
&& printf 'LANG=en_US.utf8\nexport LANG\n' > /etc/profile.d/locale.sh \
&& printf 'exec /usr/lib/dotnet/tools/pwsh' > /etc/profile.d/zz-pwsh.sh \
&& mkdir -p /etc/zsh \
&& printf 'LANG=en_US.utf8\nexport LANG\nexec /usr/lib/dotnet/tools/pwsh' >> /etc/zsh/zlogin \
&& mkdir -p /etc/fish \
&& printf 'if status is-login\n\tset -gx LANG en_US.utf8\n\texec /usr/lib/dotnet/tools/pwsh\nend\n' >> /etc/fish/config.fish \
&& cp -r ~/.dotnet /usr/lib/dotnet \
&& printf 'LANG="en_US.UTF-8"' > /etc/locale.conf \
&& chown -R 1000:1000 /usr/lib/dotnet \
&& rm -rf /tmp/*

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



3 changes: 3 additions & 0 deletions toolboxes/powershell-toolbox/packages.powershell
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ bat
dotnet-8-sdk
eza
fd
fish
fzf
gawk
glibc-locale-en
jq
ripgrep
sed
zoxide
zsh

0 comments on commit e512268

Please sign in to comment.