Skip to content

Commit 7bdc8e4

Browse files
authored
Install basic build dependencies prior to building gems. (#126)
Rubocop versions after 0.56.x have a native gem dependency. The `build-base` package provides the necessary toolchain. We remove it after use to reduce the size of the image.
1 parent f1300f1 commit 7bdc8e4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ RUN adduser -u 9000 -D app
66

77
COPY Gemfile Gemfile.lock /usr/src/app/
88

9-
RUN gem install bundler && \
10-
bundle install -j 4 --without=test && \
9+
RUN apk add --update build-base && \
10+
gem install bundler && \
11+
bundle install --quiet -j 4 --without=test && \
1112
chown -R app:app /usr/local/bundle && \
12-
rm -fr ~/.gem ~/.bundle ~/.wh..gem
13+
rm -fr ~/.gem ~/.bundle ~/.wh..gem && \
14+
apk del build-base
1315

1416
COPY . /usr/src/app
1517
RUN chown -R app:app .

0 commit comments

Comments
 (0)