#71 cache image layer in Dockerfile
Opened 2 years ago by emma50. Modified 2 years ago
fedora-qa/ emma50/landingpage dockerfile_optimization  into  master

file modified
+2 -1
@@ -1,8 +1,9 @@ 

  FROM node:8 as react-build

  WORKDIR /app

+ COPY package.json yarn.lock ./

+ RUN yarn

  COPY . ./

  RUN chmod -v +x ./start.sh

- RUN yarn

  RUN yarn build

  

  

What?

I've added support for package.json and yarn.lock file cache in the dockerfile. see #70.

Why?

To enable container image faster build time.

How?

By caching package.json and yarn.lock file in the dockerfile before the run yarn command.

Metadata