-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Make brew work without relinking.
fix: Move grabbing distrobox utilities to wofli container from bluefin-cli. fix: Fix spacing in Exec Lines for bluefin-cli and Wolfi quadlet. chore: Update package list for Wolfi Toolbox.
- Loading branch information
Showing
7 changed files
with
54 additions
and
63 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
File renamed without changes.
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 |
---|---|---|
@@ -1,42 +1,18 @@ | ||
FROM ghcr.io/ublue-os/wolfi-toolbox | ||
|
||
LABEL com.github.containers.toolbox="true" \ | ||
usage="This image is meant to be used with the toolbox or distrobox command" \ | ||
LABEL usage="This image is meant to be used with the Toolbox or Distrobox commands" \ | ||
summary="A new cloud-native terminal experience powered by Wolfi and Homebrew" \ | ||
maintainer="[email protected]" | ||
|
||
COPY ./toolboxes/bluefin-cli/packages.bluefin-cli /toolbox-packages | ||
COPY ./toolboxes/bluefin-cli/files/etc /etc | ||
|
||
# Update image | ||
# Update image, Install Packages, and move /home/linuxbrew | ||
RUN apk update && \ | ||
apk upgrade | ||
|
||
# Add optional packages | ||
RUN grep -v '^#' /toolbox-packages | xargs apk add | ||
|
||
RUN rm /toolbox-packages | ||
|
||
# Have Linuxbrew owned by UID = 1000 | ||
RUN chown -R 1000 /home/linuxbrew | ||
|
||
# Give UID = 1000 sudo | ||
RUN echo "#1000 ALL = (root) NOPASSWD:ALL" >> /etc/sudoers | ||
|
||
# Get Distrobox-host-exec and host-spawn | ||
RUN git clone https://github.com/89luca89/distrobox.git --single-branch /tmp/distrobox && \ | ||
cp /tmp/distrobox/distrobox-host-exec /usr/bin/distrobox-host-exec && \ | ||
wget https://github.com/1player/host-spawn/releases/download/$(cat /tmp/distrobox/distrobox-host-exec | grep host_spawn_version= | cut -d "\"" -f 2)/host-spawn-$(uname -m) -O /usr/bin/host-spawn && \ | ||
chmod +x /usr/bin/host-spawn && \ | ||
rm -drf /tmp/distrobox && \ | ||
ln -fs /bin/sh /usr/bin/sh | ||
|
||
# Make some symlinks | ||
RUN mkdir -p /usr/local/bin && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/flatpak && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/podman && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree | ||
apk upgrade && \ | ||
grep -v '^#' /toolbox-packages | xargs apk add && \ | ||
mv /home/linuxbrew /home/homebrew && \ | ||
rm /toolbox-packages | ||
|
||
# Change root shell to BASH | ||
RUN sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd |
24 changes: 10 additions & 14 deletions
24
toolboxes/bluefin-cli/files/etc/profile.d/bluefin-cli-brew-firstrun.sh
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,16 +1,12 @@ | ||
if test "$(id -u)" -gt "0" && test ! -f /home/linuxbrew/.firstrun && test -d /home/linuxbrew/.linuxbrew/Cellar; then | ||
touch /home/linuxbrew/.firstrun | ||
if test -n "$(ls -A /home/linuxbrew/.linuxbrew/Cellar)"; then | ||
echo "Relinking Homebrew Cellar" | ||
/home/linuxbrew/.linuxbrew/bin/brew list -1 | while read line | ||
do | ||
/home/linuxbrew/.linuxbrew/bin/brew unlink $line | ||
/home/linuxbrew/.linuxbrew/bin/brew link $line | ||
done | ||
echo "Reinstalling explicictly installed Homebrew packages" | ||
/home/linuxbrew/.linuxbrew/bin/brew leaves | while read line | ||
do | ||
/home/linuxbrew/.linuxbrew/bin/brew reinstall $line | ||
done | ||
if test "$(id -u)" -gt "0" && test ! -f /etc/linuxbrew.firstrun; then | ||
echo "First Run Setup" | ||
if test -d /home/linuxbrew; then | ||
echo "Getting newest repo version of brew" | ||
su-exec root cp -R /home/homebrew/.linuxbrew /home/linuxbrew/ | ||
echo "Making sure linuxbrew is owned by ${USER}" | ||
su-exec root chown -R $UID /home/linuxbrew | ||
fi | ||
echo "Setting up sudo for ${USER}" | ||
echo "#${UID} ALL = (root) NOPASSWD:ALL" | su-exec root tee -a /etc/sudoers > /dev/null | ||
su-exec root touch /etc/linuxbrew.firstrun | ||
fi |
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,8 +1,7 @@ | ||
FROM cgr.dev/chainguard/wolfi-base | ||
# Thanks to Nuno do Carmo for the initial prototype | ||
|
||
LABEL com.github.containers.toolbox="true" \ | ||
usage="This image is meant to be used with the toolbox or distrobox command" \ | ||
LABEL usage="This image is meant to be used with the Toolbox or Distrobox command" \ | ||
summary="A blank Wolfi distrobox, suitable for development" \ | ||
maintainer="[email protected]" | ||
|
||
|
@@ -17,5 +16,23 @@ RUN grep -v '^#' /toolbox-packages | xargs apk add | |
|
||
RUN rm /toolbox-packages | ||
|
||
|
||
# Get Distrobox-host-exec and host-spawn | ||
RUN git clone https://github.com/89luca89/distrobox.git --single-branch /tmp/distrobox && \ | ||
cp /tmp/distrobox/distrobox-host-exec /usr/bin/distrobox-host-exec && \ | ||
cp /tmp/distrobox/distrobox-export /usr/bin/distrobox-export && \ | ||
cp /tmp/distrobox/distrobox-init /usr/bin/entrypoint && \ | ||
wget https://github.com/1player/host-spawn/releases/download/$(cat /tmp/distrobox/distrobox-host-exec | grep host_spawn_version= | cut -d "\"" -f 2)/host-spawn-$(uname -m) -O /usr/bin/host-spawn && \ | ||
chmod +x /usr/bin/host-spawn && \ | ||
rm -drf /tmp/distrobox && \ | ||
ln -fs /bin/sh /usr/bin/sh | ||
|
||
# Make some symlinks | ||
RUN mkdir -p /usr/local/bin && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/docker && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/flatpak && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/podman && \ | ||
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree | ||
|
||
# Change root shell to BASH | ||
RUN sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd |
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