Vraiment / containerized-ruby-build

rbenv plugin to build Ruby within a container
MIT License
0 stars 0 forks source link

Allow image to be used for other than building #2

Open Vraiment opened 5 days ago

Vraiment commented 5 days ago

idem

Sample use case: run gem install or bundle install

Vraiment commented 5 days ago

Note on the gem install use case:

  1. I had to add (locally) git to the image as the default bundler template uses git to detect which files are part of the gem
  2. Had to modify the docker command to be:
    docker run \
    --user "$(id --user)":"$(id --group)" \
    --volume "$(rbenv root)":"$(rbenv root)" \
    --volume "$PWD":"$PWD" \
    --workdir "$PWD" \
    --env USER \
    --env HOME \
    --env RBENV_ROOT="$(rbenv root)" \
    --interactive \
    --tty \
    875ab879a007 \
    /bin/bash
  3. Inside the container had to run:
    PATH="$HOME"/.rbenv/bin:"$PATH"
    eval "$(rbenv init -)"