我正在尝试使用此 docker 文件运行 Angular 应用程序容器:
# stage 1
FROM node:alpine AS my-app-build
WORKDIR /app
COPY . .
RUN npm install @openapitools/openapi-generator-cli -g
RUN npm run build
# stage 2
FROM nginx:alpine
COPY --from=my-app-build /app/dist/ /usr/share/nginx/html
EXPOSE 80
我需要 openapitools 来生成我的客户端 api,但我收到以下错误消息:
/usr/local/lib/node_modules/@openapitools/openapi-generator-cli/main.js:636
error ? reject(new Error(stderr)) : resolve(stdout);
^
Error: /bin/sh: java: not found
at /usr/local/lib/node_modules/@openapitools/openapi-generator-cli/main.js:636:32
at ChildProcess.exithandler (node:child_process:404:5)
at ChildProcess.emit (node:events:390:28)
at maybeClose (node:internal/child_process:1062:16)
at Socket.<anonymous> (node:internal/child_process:448:11)
at Socket.emit (node:events:390:28)
at Pipe.<anonymous> (node:net:687:12)
Node.js v17.3.1
Error response from daemon: The command '/bin/sh -c npm run build' returned a non-zero code: 1
为什么我需要java?我必须安装它吗?