Skip to content

Commit ca027c2

Browse files
authored
user and group defined in alias and change permits for bundle (#15)
* user and group defined in alias and change permits for bundle * configuring it as ENV it's not user specific
1 parent 54b9602 commit ca027c2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ RUN apt-get update -qq && apt-get install -y nodejs && npm install -g yarn
1919
WORKDIR /rails
2020

2121
# Ensure gems are installed on a persistent volume and available as bins
22+
# Make the folder world writable to let the default user install the gems
23+
RUN mkdir /bundle && chmod -R ugo+rwt /bundle
2224
VOLUME /bundle
23-
RUN bundle config set --global path '/bundle'
25+
ENV BUNDLE_PATH='/bundle'
2426
ENV PATH="/bundle/ruby/$RUBY_VERSION/bin:${PATH}"
2527

2628
# Install Rails

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Install [Docker](https://www.docker.com/products/docker-desktop/) (and [WSL](htt
66

77
```bash
88
docker volume create ruby-bundle-cache
9-
alias docked='docker run --rm -it -v ${PWD}:/rails -v ruby-bundle-cache:/bundle -p 3000:3000 ghcr.io/rails/cli'
9+
alias docked='docker run --rm -it -v ${PWD}:/rails -u $(id -u):$(id -g) -v ruby-bundle-cache:/bundle -p 3000:3000 ghcr.io/rails/cli'
1010
```
1111

1212
Then create your Rails app:

0 commit comments

Comments
 (0)