尝试使用以下文件创建/ app目录时出现错误。过去这对我有用,所以我不确定现在出了什么问题:
Step 1/8 : FROM node:alpine
---> 0d8a3475dbc3
Step 2/8 : RUN MKDIR -p "/app"
---> Running in ad24819ce982
/bin/sh: MKDIR: not found
ERROR: Service 'add_delete_server' failed to build: The command '/bin/sh -c MKDIR -p "/app"' returned a non-zero code: 127
Docker撰写:version: "3.8"
services:
add_delete_server:
build:
context: ./AddDeleteServer
dockerfile: Dockerfile.dev
ports:
- "3001:3001"
volumes:
- /app/node_modules
- ./server:/app
Dockerfile.devFROM node:alpine
#setting work directory
RUN MKDIR -p "/app"
WORKDIR "/app"
#copying only package.json first, so cache can be used for minor changes
COPY package.json .
COPY package-lock.json .
RUN npm install
# copy rest of files
COPY . .
CMD ["npm", "run","dev"]
但我无法产生
最佳答案
MKDIR
不是命令,mkdir
是命令
关于docker - Dockerfile MKDIR不起作用(node:alpine),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63585819/