The dockerfile builds locally but the GitLab pipeline fails, saying:
Step 3/8 : RUN gem install bundler rake
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/local/bundle directory.
The project strucutre is a Ruby Sinatra backend and a React frontend.
The Dockerfile looks like this
# Install Dependencies
RUN apk update && apk add --no-cache build-base mysql-dev rrdtool
RUN gem install bundler rake
# Copy the files and build
COPY . .
RUN bundler install
# Run bundler
CMD ["bundle", "exec", "puma"]
I thought Docker meant was meant to solve the problem of "it runs on my machine"…
As per this post, I tried adding -n /usr/local/bundle but it did not fix the issue.
Source: Docker Questions
Our dedicated development team is here for you!
We can help you find answers to your question for as low as 5$.