Skip to content

Commit

Permalink
resolving build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalderon committed Dec 31, 2023
1 parent d534dc0 commit 17310fc
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 24 deletions.
44 changes: 25 additions & 19 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Start from the Fedora Toolbox image
FROM quay.io/toolbx-images/fedora-toolbox:38
ENV HOMEBREW_NO_ENV_HINTS=true
ENV HOMEBREW_NO_ENV_HINTS=true

# Add user jim
RUN useradd -m -s /bin/bash jim

# Import Microsoft GPG key and add Visual Studio Code repository
RUN rpm --import https://packages.microsoft.com/keys/microsoft.asc
RUN sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'

Expand All @@ -13,26 +17,28 @@ COPY packages.dnf /tmp/packages.dnf

# Install packages from the list
RUN dnf -y install $(cat /tmp/packages.dnf)
# RUN dnf groupinstall "Development Tools"

# Install Homebrew
# RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# # Sym-link to host binaries
# RUN ln -fs /bin/sh /usr/bin/sh && \
# 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 && \
# ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/transactional-update

# Add Homebrew to PATH
ENV PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"
# Copy the install script and packages file
COPY install_homebrew.sh /home/jim/
COPY packages.brew /home/jim/tmp/

# Copy the list of Homebrew applications into the container
# COPY packages.brew /tmp/packages.brew
# Change ownership to jim and make the script executable
RUN chown -R jim:jim /home/jim/install_homebrew.sh /home/jim/tmp/ && \
chmod u+x /home/jim/install_homebrew.sh

# Install Homebrew applications from the list
# RUN while read app; do brew install "$app"; done < /tmp/packages.brew
# RUN brew install $(cat /tmp/packages.brew)
# Switch to user jim
USER jim

# Add Homebrew to PATH
ENV PATH="/home/linuxbrew/.linuxbrew/bin:${PATH}"

# sym-link to host binaries
RUN ln -fs /bin/sh /usr/bin/sh && \
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 && \
ln -fs /usr/bin/distrobox-host-exec /usr/local/bin/transactional-update
# Set the script to run on login
RUN echo '[[ -f $HOME/install_homebrew.sh ]] && /bin/bash $HOME/install_homebrew.sh' >> /home/jim/.bashrc
5 changes: 0 additions & 5 deletions brew.install.sh

This file was deleted.

13 changes: 13 additions & 0 deletions install_homebrew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# Check if Homebrew is installed
if [ ! -d "/home/linuxbrew/.linuxbrew" ]; then
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Homebrew applications from the list
brew install $(cat /home/jim/tmp/packages.brew)
fi

# Remove the script to prevent it from running again
rm -f $HOME/install_homebrew.sh

0 comments on commit 17310fc

Please sign in to comment.