Ruby package permission issues on alpine 3.14
I hope this is the right place for such an issue, apologies if not.
This is a problem that just started recently. Installing ruby on alpine 3.14 creates what seems to be an unusable installation.
This is the most minimal Dockerfile that reproduces the problem:
FROM alpine:3.14
RUN apk --no-cache add ruby
RUN gem install bundler
- When this is built locally on my Ubuntu, it works.
- When it is built on DockerHub - it breaks.
- When it is built on DockerHub with
FROM alpine 3.13
- it works.
At first, this was so weird that I thought it is only my problem, but then I found this on StackOverflow - with the same problem.
The error message:
Step 3/3 : RUN gem install bundler
---> Running in 88cb7aa4d4f3
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/lib/ruby/gems/2.7.0 directory.
As a side note - Ruby 3.x is out for a while now, and the most recent apk package is still 2.7. Would be nice if it was updated soon.