Angular Open Shift deployment failed on docker copy stage

101 Views Asked by At

I am trying to deploy angular to openshift, but I am getting issues on docker copy stage

--> 68671715781
[2/2] STEP 5/8: COPY --from=0 /dist/frontend /usr/share/nginx/html
error: build error: error building at STEP "COPY --from=0 /dist/frontend /usr/share/nginx/html": checking on sources under "/var/lib/containers/storage/overlay/e16d5b2c18831dddf755ed3fa87f3bcac4f0720c799764d8dfe4bd5c5a8aa3dc/merged": copier: stat: "/dist/frontend": no such file or directory

I have select Docker file Strategy to deploy on openshift.

enter image description here

DockerFile

FROM node:14.20-alpine

WORKDIR /usr/src/app
COPY package.json package.json
RUN npm install --silent
COPY . .

RUN npm run build --prod --output-path=/dist/frontend

# stage 2
FROM nginx:alpine
WORKDIR /usr/src/app
RUN rm -rf /usr/share/nginx/html/*
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=0 /dist/frontend /usr/share/nginx/html

CMD ["nginx", "-g", "daemon off;"]

Angular.json output directory set to dist/frontend

enter image description here

0

There are 0 best solutions below