bcgsc / orca

:whale: Genomics Research Container Architecture
http://www.bcgsc.ca/services/orca
GNU General Public License v3.0
48 stars 13 forks source link

brew install ... doesn't work (Martin's class) #30

Open tmozgach opened 6 years ago

tmozgach commented 6 years ago

Temporary solution:

First create this directory:

mkdir -p -m775 ~/.cache/Homebrew

Then create a .bashrc (dot bashrc) file in their home directory. To do this, you can copy the code between the dotted line. And paste into the terminal:

echo '# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=

# User specific aliases and functions
alias brew='sudo -u linuxbrew HOMEBREW_NO_AUTO_UPDATE=1 /home/linuxbrew/.linuxbrew/bin/brew'
' >> ~/.bashrc

Then log out and log back in for it to take effect.

Now brew install nano will work for example

Possible permanent solution for future (Hackseq?): 1) mount the file .bashrc in read-only mode ( docker run -v ....:ro ) 2) run container in the backround mode (docker run -d ...) 3) execute a container and pass the command mkdir -p -m775 ~/.cache/Homebrew ( docker exec -it -u $(id -u):$(id -g) <<<CONTAINER_ID>>> /bin/bash -c "mkdir -p -m775 ~/.cache/Homebrew && /bin/bash”)