Reputation: 15
This is the dockerfile:
FROM node:16
WORKDIR /app
COPY package.json .
RUN npm install
COPY . ./
EXPOSE 5000
CMD ["npm","run","dev"]
Every time I run the build command , it downloads from node image as instructed at first line.But I thought I was cached to make the image building faster. The total time it takes is like 600+ seconds. Is there a way to make the build proccess faster?
Upvotes: 0
Views: 1088
Reputation: 7891
You have to set a tag. Otherwise docker can't know where it can find the related cache.
docker build -t yourImageName:yourTag .
See also this for more informations
Upvotes: 3