我正在尝试在Windows机器上为React App构建一个docker镜像,主机和客户端都是Windows。当我尝试构建docker时成功了,但是当我尝试运行它时说nginx不行,我们需要在客户端计算机上也安装nginx。这是Docker文件:-
# Stage 1
FROM node:8 as react-build
WORKDIR /app
COPY . ./
RUN yarn
RUN yarn build
# Stage 2 - the production environment
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=react-build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
错误:-
/bin/sh: [“nginx”,: not found
/bin/sh: ”]: not found