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”)
Temporary solution:
First create this directory:
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:
Then log out and log back in for it to take effect.
Now
brew install nano
will work for examplePossible 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 commandmkdir -p -m775 ~/.cache/Homebrew
(docker exec -it -u $(id -u):$(id -g) <<<CONTAINER_ID>>> /bin/bash -c "mkdir -p -m775 ~/.cache/Homebrew && /bin/bash”
)