-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
93 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# ✅ build bash 5.0 | ||
FROM bitnami/minideb:bookworm as bash5-builder | ||
|
||
SHELL ["/bin/sh", "-o", "errexit", "-o", "nounset", "-x", "-c"] | ||
|
||
ARG STANDARD_PACKAGES="build-essential wget" | ||
|
||
RUN \ | ||
install_packages ${STANDARD_PACKAGES} ; \ | ||
cd /tmp; \ | ||
wget http://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz; \ | ||
tar xf bash-5.0.tar.gz; \ | ||
cd bash-5.0; \ | ||
./configure; \ | ||
make; \ | ||
make install; | ||
|
||
FROM bitnami/minideb:bookworm | ||
|
||
SHELL ["/bin/sh", "-o", "errexit", "-o", "nounset", "-x", "-c"] | ||
|
||
ARG STANDARD_PACKAGES="locales ca-certificates curl sudo makepasswd uidmap git xonsh fish zsh csh tcsh ksh wget" | ||
|
||
# ✅ copy bash 5.0 | ||
COPY --from=bash5-builder /usr/local /usr/local/ | ||
|
||
# ✅ install packages + set up locale | ||
ARG LOCALE=en_US | ||
ENV LANG=${LOCALE}.UTF-8 | ||
ENV LC_ALL=${LOCALE}.UTF-8 | ||
ENV LANGUAGE=${LOCALE}.UTF-8 | ||
RUN \ | ||
install_packages ${STANDARD_PACKAGES} ; \ | ||
localedef -i ${LOCALE} -c -f UTF-8 -A /usr/share/locale/locale.alias ${LOCALE}.UTF-8; \ | ||
echo "${LOCALE}.UTF-8 UTF-8" >> /etc/locale.gen; \ | ||
echo "LANG=${LOCALE}.UTF-8" >> /etc/locale.conf; \ | ||
locale-gen ${LOCALE}.UTF-8; \ | ||
echo 'me' > /tmp/pw; \ | ||
useradd -m -u 1000 -U -p "$(makepasswd --crypt-md5 --clearfrom=/tmp/pw)" me; \ | ||
echo "me ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/me-sudo; \ | ||
chsh -s /bin/bash me; \ | ||
pushd /tmp; \ | ||
curl -fsSL https://github.com/nushell/nushell/releases/download/0.100.0/nu-0.100.0-x86_64-unknown-linux-gnu.tar.gz -o nu.tar.gz; \ | ||
tar -xvf nu.tar.gz; \ | ||
mv nu-0.100.0-x86_64-unknown-linux-gnu/nu /usr/local/bin/nu; \ | ||
curl -fsSL https://github.com/dandavison/delta/releases/download/0.18.2/delta-0.18.2-x86_64-unknown-linux-gnu.tar.gz -O; \ | ||
tar -xvf delta-0.18.2-x86_64-unknown-linux-gnu.tar.gz; \ | ||
mv delta-0.18.2-x86_64-unknown-linux-gnu/delta /usr/local/bin/delta; \ | ||
popd; \ | ||
rm -rf /tmp/* \ | ||
rm /bin/bash; \ | ||
sudo ln -s /usr/local/bin/bash /bin/bash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,52 @@ | ||
FROM bitnami/minideb:bookworm | ||
# ✅ build bash 5.0 | ||
FROM bitnami/minideb:bookworm as bash5-builder | ||
|
||
SHELL ["/bin/sh", "-o", "errexit", "-o", "nounset", "-x", "-c"] | ||
|
||
ARG STANDARD_PACKAGES="build-essential wget" | ||
|
||
RUN \ | ||
install_packages ${STANDARD_PACKAGES} ; \ | ||
cd /tmp; \ | ||
wget http://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz; \ | ||
tar xf bash-5.0.tar.gz; \ | ||
cd bash-5.0; \ | ||
./configure; \ | ||
make; \ | ||
make install; | ||
|
||
FROM alpine | ||
|
||
SHELL ["/bin/bash", "-o", "errexit", "-o", "nounset", "-o", "pipefail", "-c", "-x"] | ||
|
||
ARG STANDARD_PACKAGES="locales ca-certificates curl sudo makepasswd uidmap git xonsh fish zsh csh tcsh ksh build-essential wget" | ||
ARG STANDARD_PACKAGES="locales ca-certificates curl sudo makepasswd uidmap git xonsh fish zsh csh tcsh ksh wget" | ||
|
||
# ✅ install packages | ||
# ✅ set up locale | ||
# ✅ copy bash 5.0 | ||
COPY --from=bash5-builder /usr/local/bin/bash /usr/local/bin/bash | ||
|
||
# ✅ install packages + set up locale | ||
ARG LOCALE=en_US | ||
ENV LANG=${LOCALE}.UTF-8 | ||
ENV LC_ALL=${LOCALE}.UTF-8 | ||
ENV LANGUAGE=${LOCALE}.UTF-8 | ||
RUN \ | ||
install_packages ${STANDARD_PACKAGES} ; \ | ||
localedef -i ${LOCALE} -c -f UTF-8 -A /usr/share/locale/locale.alias ${LOCALE}.UTF-8; \ | ||
echo "${LOCALE}.UTF-8 UTF-8" >> /etc/locale.gen; \ | ||
echo "LANG=${LOCALE}.UTF-8" >> /etc/locale.conf; \ | ||
locale-gen ${LOCALE}.UTF-8; \ | ||
echo 'me' > /tmp/pw; \ | ||
useradd -m -u 1000 -U -p "$(makepasswd --crypt-md5 --clearfrom=/tmp/pw)" me; \ | ||
echo "me ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/me-sudo; \ | ||
chsh -s /bin/bash me; \ | ||
curl -fsSL https://github.com/nushell/nushell/releases/download/0.100.0/nu-0.100.0-x86_64-unknown-linux-gnu.tar.gz -o nu.tar.gz; \ | ||
tar -xvf nu.tar.gz; \ | ||
mv nu-0.100.0-x86_64-unknown-linux-gnu/nu /usr/local/bin/nu; | ||
|
||
# ✅ instal delta | ||
RUN \ | ||
install_packages ${STANDARD_PACKAGES} ; \ | ||
localedef -i ${LOCALE} -c -f UTF-8 -A /usr/share/locale/locale.alias ${LOCALE}.UTF-8; \ | ||
echo "${LOCALE}.UTF-8 UTF-8" >> /etc/locale.gen; \ | ||
echo "LANG=${LOCALE}.UTF-8" >> /etc/locale.conf; \ | ||
locale-gen ${LOCALE}.UTF-8; \ | ||
echo 'me' > /tmp/pw; \ | ||
useradd -m -u 1000 -U -p "$(makepasswd --crypt-md5 --clearfrom=/tmp/pw)" me; \ | ||
echo "me ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers.d/me-sudo; \ | ||
chsh -s /bin/bash me; \ | ||
pushd /tmp; \ | ||
curl -fsSL https://github.com/nushell/nushell/releases/download/0.100.0/nu-0.100.0-x86_64-unknown-linux-gnu.tar.gz -o nu.tar.gz; \ | ||
tar -xvf nu.tar.gz; \ | ||
mv nu-0.100.0-x86_64-unknown-linux-gnu/nu /usr/local/bin/nu; \ | ||
curl -fsSL https://github.com/dandavison/delta/releases/download/0.18.2/delta-0.18.2-x86_64-unknown-linux-gnu.tar.gz -O; \ | ||
tar -xvf delta-0.18.2-x86_64-unknown-linux-gnu.tar.gz; \ | ||
mv delta-0.18.2-x86_64-unknown-linux-gnu/delta /usr/local/bin/delta; \ | ||
popd; \ | ||
rm -rf /tmp/* | ||
|
||
# now install bash 5.0 | ||
SHELL ["/bin/sh", "-o", "errexit", "-o", "nounset", "-x", "-c"] | ||
|
||
RUN \ | ||
cd /tmp; \ | ||
wget http://ftp.gnu.org/gnu/bash/bash-5.0.tar.gz; \ | ||
tar xf bash-5.0.tar.gz; \ | ||
cd bash-5.0; \ | ||
./configure; \ | ||
make; \ | ||
sudo make install; \ | ||
rm /bin/bash; \ | ||
sudo ln -s /usr/local/bin/bash /bin/bash; | ||
rm -rf /tmp/* \ | ||
rm /bin/bash; \ | ||
sudo ln -s /usr/local/bin/bash /bin/bash; |