From 0bd9c512c29f505127beed808b17c1843e53003a Mon Sep 17 00:00:00 2001 From: RyanSquared Date: Sun, 30 Apr 2023 06:16:30 -0400 Subject: [PATCH] Dockerfile: use multistage build to avoid shipping build tools --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4634758..dcf8065 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,17 @@ -FROM jekyll/minimal:3.8 +FROM ruby:3.2.2-alpine AS builder RUN apk update && apk add g++ make RUN mkdir -p /home COPY Gemfile /home COPY Gemfile.lock /home -RUN chmod -R 777 /home WORKDIR /home RUN bundle install +FROM ruby:3.2.2-alpine + +COPY --from=builder /usr/local/bundle /usr/local/bundle +RUN mkdir -p /home +WORKDIR /home + CMD ["jekyll", "serve"]