Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Cleanup bluefin-cli #801

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions just/custom.just
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ bluefin-cli:
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/bluefin-cli/Cellar"
fi;
distrobox-create --nvidia --image ghcr.io/ublue-os/bluefin-cli:latest -n bluefin --volume "${XDG_DATA_HOME:-$HOME/.local/share}/bluefin-cli/Cellar":/home/linuxbrew/.linuxbrew/Cellar:z
echo "Setting up bluefin-cli"
distrobox enter -n bluefin -T -e brew_script
echo "Entering bluefin-cli"
distrobox enter -n bluefin

Expand Down
21 changes: 8 additions & 13 deletions toolboxes/Containerfile.bluefin-cli
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ LABEL com.github.containers.toolbox="true" \
maintainer="jorge.castro@gmail.com"

COPY ./toolboxes/packages.bluefin-cli /toolbox-packages

# Install brew_script
COPY ./toolboxes/files.bluefin-cli/brew_script.bluefin-cli /tmp/brew_script
RUN install -Dm755 /tmp/brew_script /usr/bin/brew_script
COPY ./toolboxes/files.bluefin-cli/etc /etc

# Update image
RUN apk update && \
Expand All @@ -20,6 +17,12 @@ 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 && \
Expand All @@ -35,13 +38,5 @@ RUN mkdir -p /usr/local/bin && \
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/podman && \
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/rpm-ostree

# Make Sudo Work (Assumes UID = 1000)
COPY ./toolboxes/files.bluefin-cli/etc/sudoers /etc/sudoers
COPY ./toolboxes/files.bluefin-cli/etc/pam.d /etc/pam.d

# Have Linuxbrew owned by UID = 1000
RUN chown -R 1000 /home/linuxbrew

# Change root shell to BASH

RUN sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd
RUN sed -i -e '/^root/s/\/bin\/ash/\/bin\/bash/' /etc/passwd
7 changes: 0 additions & 7 deletions toolboxes/files.bluefin-cli/etc/pam.d/sudo

This file was deleted.

7 changes: 0 additions & 7 deletions toolboxes/files.bluefin-cli/etc/pam.d/sudo-i

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/usr/bin/env bash

if [ ! -f /home/linuxbrew/.firstrun ]; then
if test "$(id -u)" -gt "0" && test ! -f /home/linuxbrew/.firstrun && test -d /home/linuxbrew/.linuxbrew/Cellar; then
touch /home/linuxbrew/.firstrun

# Package Relink
if [ -n "$(ls -A /home/linuxbrew/.linuxbrew/Cellar)" ]; then
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
Expand Down
3 changes: 0 additions & 3 deletions toolboxes/files.bluefin-cli/etc/sudoers

This file was deleted.

Loading