Skip to content

Commit

Permalink
Merge pull request #2397 from cloudnativedaysjp/docker-check
Browse files Browse the repository at this point in the history
docker build --check の簡単なものを直す
  • Loading branch information
takaishi authored Sep 18, 2024
2 parents b49c98c + f97f728 commit c858497
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# syntax = docker/dockerfile:1.9

FROM node:18.20.4-slim as node
FROM node:18.20.4-slim AS node
WORKDIR /app
COPY --link package.json yarn.lock ./
RUN --mount=type=cache,uid=1000,target=/app/.cache/node_modules \
yarn install --modules-folder .cache/node_modules && \
cp -ar .cache/node_modules node_modules

FROM public.ecr.aws/docker/library/ruby:3.3.4 as fetch-lib
FROM public.ecr.aws/docker/library/ruby:3.3.4 AS fetch-lib
WORKDIR /app
COPY --link Gemfile* ./
RUN apt-get update && apt-get install -y shared-mime-info libmariadb3
RUN bundle install

FROM public.ecr.aws/docker/library/ruby:3.3.4 as asset-compile
ENV YARN_VERSION 1.22.19
FROM public.ecr.aws/docker/library/ruby:3.3.4 AS asset-compile
ENV YARN_VERSION=1.22.19
COPY --link --from=node /opt/yarn-v$YARN_VERSION /opt/yarn
COPY --link --from=node /usr/local/bin/node /usr/local/bin/
RUN ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
Expand All @@ -37,7 +37,7 @@ RUN --mount=type=cache,uid=1000,target=/app/tmp/cache SECRET_KEY_BASE=hoge RAILS

FROM public.ecr.aws/docker/library/ruby:3.3.4-slim

ENV YARN_VERSION 1.22.19
ENV YARN_VERSION=1.22.19
COPY --link --from=node /opt/yarn-v$YARN_VERSION /opt/yarn
COPY --link --from=node /usr/local/bin/node /usr/local/bin/
RUN ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
Expand Down

0 comments on commit c858497

Please sign in to comment.