Dockerfile: use multistage build to avoid shipping build tools
This commit is contained in:
parent
a3c94eef9f
commit
0bd9c512c2
|
@ -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 apk update && apk add g++ make
|
||||||
|
|
||||||
RUN mkdir -p /home
|
RUN mkdir -p /home
|
||||||
COPY Gemfile /home
|
COPY Gemfile /home
|
||||||
COPY Gemfile.lock /home
|
COPY Gemfile.lock /home
|
||||||
RUN chmod -R 777 /home
|
|
||||||
WORKDIR /home
|
WORKDIR /home
|
||||||
RUN bundle install
|
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"]
|
CMD ["jekyll", "serve"]
|
||||||
|
|
Loading…
Reference in New Issue