Coder Social home page Coder Social logo

Comments (6)

tjamet avatar tjamet commented on May 12, 2024

Hi! sorry I missed this one.

can I ask you how is whalebrew /usr/local/bin/rush --version working?

from whalebrew.

DannyBen avatar DannyBen commented on May 12, 2024

Same thing. But when running sudo whalebrew, it works.

$ whalebrew /usr/local/bin/rush --version
bash: /usr/local/bin/rush: Permission denied

$ sudo whalebrew /usr/local/bin/rush --version
0.5.8

$ ls -l /usr/local/bin/{whale,rush}*
-rwxr-xr-x 1 root root       64 Oct 16 13:59 /usr/local/bin/rush
-rwxrwxrwx 1 root root 15958371 Oct 16 13:44 /usr/local/bin/whalebrew

Note that I am testing it with whalebrew 0.2.3, since 0.2.4 does not work.

from whalebrew.

tjamet avatar tjamet commented on May 12, 2024

ok, I think I understand what is happening
When you run a package, whalebrew will, by default, add the -u $(id -u):$(id -g) fo files are mounted and executed as the standard user.
I am not familiar with rush at all but it looks like it does not support to be run as a different user than the one it is built for in the container.
For this, whalebrew has an option to keep the same user as in the image: LABEL io.whalebrew.config.keep_container_user 'true'
You can also edit your /usr/local/bin/rush and add the option keep_container_user: true in a new line.

in other words, your /usr/local/bin/rush should look like

#!/usr/bin/env whalebrew
image: dannyben/rush
working_dir: /app
keep_container_user: true

This will have the effect to disable the default option to keep the current user ID:

if !p.KeepContainerUser {

from whalebrew.

DannyBen avatar DannyBen commented on May 12, 2024

I don' understand - why are you modifying container users in the first place?
I thought the entire mandate of whalebrew was to provide alternative to

alias rush="docker run -it --rm dannyben/rush"

If it runs with "docker run..." it should run with whalebrew.

from whalebrew.

tjamet avatar tjamet commented on May 12, 2024

The purpose of running as user is to solve the problem of writing to files.
The purpose of whalebrew is to provide a package manager

like Homebrew, but with Docker images

When you install any package on your system, later, when you run the command as any user, you expect the command to be run as your user. Here Whalebrew has, by default, the same behaviour.

A large proportion of the packages actually needs to access and write files on the filesystem, which, in case this flag is not set, issues like #40 or #11 . There are though, as you pointed, some packages for which the user ID they set is important. They are, from my experience, mostly packages that does not need to access the file system. For those, whalebrew has the keep_container_user flag described above.

from whalebrew.

DannyBen avatar DannyBen commented on May 12, 2024

Thanks. I am closing this.

For my needs, any of the below two approaches is probably more suitable:

alias rush="docker run -it --rm dannyben/rush"

or, to create a file /usr/local/bin/rush

#!/usr/bin/env bash
docker run -it --rm dannyben/rush

from whalebrew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.