I’m trying to have a Docker image packaged with linuxbrew.
The setup is to create a user “sf” with sudo privileges and then install linuxbrew via the regular command. Nothing fancy.
Afterwards, the intention is to pull this image, run it, create another user “ci” with sudo privileges, which should have access to run “brew install” and similar. In the setup of user “ci”, I currently install linuxbrew (again), because I cannot be sure if linuxbrew is already installed and working properly. Reinstalling homebrew/linuxbrew on a working machine is more or less equivalent to “brew update” afaik.
But running the linuxbrew install script via user “ci” fails because it does not have permissions to /home/linuxbrew.
I have tried creating a “brew” group and assign both users “sf” and “ci” to it, and also
“sudo chgrp -R brew /home/linuxbrew”, but the install script fails anyway “Permission denied” when tar is executed https://github.com/Linuxbrew/install/blob/master/install-ruby#L24-L25
EDIT: actually the error messages say smth else than “Permission denied”
698tar: portable-ruby/2.3.7/bin/irb: Cannot open: File exists
699tar: portable-ruby/2.3.7/bin/erb: Cannot open: File exists
700tar: portable-ruby/2.3.7/bin/gem: Cannot open: File exists
701tar: portable-ruby/2.3.7/bin/rdoc: Cannot open: File exists
702tar: portable-ruby/2.3.7/bin/ruby: Cannot open: File exists
703tar: portable-ruby/2.3.7/bin/ri: Cannot open: File exists
704tar: portable-ruby/2.3.7/bin: Cannot utime: Operation not permitted
705tar: portable-ruby/2.3.7/bin: Cannot change mode to rwxr-xr-x: Operation not permitted