From 1143ad145684fdfee3f1b2587e0fe54a8317c157 Mon Sep 17 00:00:00 2001 From: Matt Schwager Date: Tue, 23 Jan 2024 11:54:34 -0700 Subject: [PATCH] Improve Dockerfile caching of dependencies --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 59a5bd0..0b70a1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,12 +45,15 @@ ENV MAKE "make --environment-overrides V=1" # 2. The Ruby interpreter leaks data, so ignore these for now ENV ASAN_OPTIONS "allocator_may_return_null=1,detect_leaks=0" -COPY . ruzzy/ +# Split dependency and application code installation for improved caching +COPY ruzzy.gemspec Gemfile ruzzy/ WORKDIR ruzzy/ RUN bundler3.1 install + +COPY . . RUN rake compile ENV LD_PRELOAD "$CLANG_DIR/lib/clang/17/lib/$CLANG_ARCH-unknown-linux-gnu/libclang_rt.asan.so" -ENTRYPOINT ["ruby", "bin/dummy.rb"] +ENTRYPOINT ["ruby", "-Ilib", "bin/dummy.rb"] CMD ["-help=1"]