Skip to content

Commit ab51aff

Browse files
committed
Fix Dockerfile for Ruby 4.0 - install build deps for nokogiri
Ruby 4.0 requires compiling nokogiri from source, so we need to temporarily install build dependencies during gem installation.
1 parent f6d341a commit ab51aff

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,22 @@ RUN gem build llm-docs-builder.gemspec
3838
# Stage 2: Runtime
3939
FROM ruby:4.0-alpine
4040

41-
# Install runtime dependencies only
41+
# Install runtime dependencies and build tools for native extensions
4242
RUN apk add --no-cache \
4343
ca-certificates \
44-
tzdata
44+
tzdata \
45+
libxml2 \
46+
libxslt
4547

46-
# Copy built gem and install it
48+
# Copy built gem and install it (needs build tools for nokogiri)
4749
COPY --from=builder /gem/llm-docs-builder-*.gem /tmp/
48-
RUN gem install /tmp/llm-docs-builder-*.gem --no-document && \
49-
rm /tmp/llm-docs-builder-*.gem
50+
RUN apk add --no-cache --virtual .build-deps \
51+
build-base \
52+
libxml2-dev \
53+
libxslt-dev && \
54+
gem install /tmp/llm-docs-builder-*.gem --no-document && \
55+
rm /tmp/llm-docs-builder-*.gem && \
56+
apk del .build-deps
5057

5158
# Set working directory for user files
5259
WORKDIR /workspace

0 commit comments

Comments
 (0)