Check your .dockerignore
file. Possible it ignores needed files for copy command and you get failed to compute cache key error.
.dockerignore
may be configured to minimize the files sent to docker for performance and security:
*
!dist/
The first line *
disallows all files. The second line !dist/
allows the dist
folder
This can cause unexpected behavior:
FROM nginx:latest
# Fails because of * in .dockerignore
# failed to compute cache key: "/nginx.conf.spa" not found: not found
# Fix by adding `!nginx.conf.spa` to .dockerignore
COPY nginx.conf.spa /etc/nginx/nginx.conf
RUN mkdir /app
# Works because of !dist/ in .dockerignore
COPY dist/spa /app
Belts and suspenders.