Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (32 loc) · 1.5 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (32 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM jruby:10.0.8.0-jdk21@sha256:c63ddee8494abab401f1f49ff5864672c22ba00f539b6f93579853350fa83e24
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libicu-dev netbase make
# used for skipping jenv/rbenv setup
ENV IS_DOCKER=1
# Set up crawlergroup and crawleruser
RUN groupadd -g 451 crawlergroup && \
useradd -m -u 451 -g crawlergroup crawleruser
# Copy and set up Crawler as crawleruser
USER crawleruser
COPY --chown=crawleruser:crawlergroup --chmod=775 . /home/app
WORKDIR /home/app
# Exclude development and test gems from the production image to reduce
# image size and CVE surface area (e.g. rack, rspec, rubocop, pry, etc.)
RUN bundle config set --local without 'development test'
RUN make clean install
# Clean up build dependencies
RUN rm -r /home/crawleruser/.m2
# Remove ruby-maven and ruby-maven-libs gems, which are only needed at build time
# for JAR dependency resolution. This also removes the bundled plexus-utils-3.5.1.jar
# (CVE-2025-67030) from the production image.
RUN rm -rf /usr/local/bundle/gems/ruby-maven-* \
/usr/local/bundle/specifications/ruby-maven-* \
/usr/local/bundle/cache/ruby-maven-*
# JRuby 10.0.8.0 ships json 2.16.0 as a default gem (CVE-2026-33210). The Gemfile requires
# json >= 2.19.2, and that locked gem loads at runtime; drop the vulnerable default spec.
# Needs root as /opt/jruby is root-owned.
USER root
RUN rm -f /opt/jruby/lib/ruby/gems/shared/specifications/default/json-2.16.0-java.gemspec
USER crawleruser
ENTRYPOINT [ "/bin/bash" ]