嗨,我正在使用 Docker 创建一个镜像,以下是 Dockerfile 中的命令
FROM node
WORKDIR /app
COPY . /app
RUN npm install
EXPOSE 80
CMD ["node", "server.js"]
当我运行命令Docker build .时,它会返回以下响应。
[+] Building 2.0s (8/8) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 138B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/node:latest 1.0s
=> [internal] load build context 0.0s
=> => transferring context: 295B 0.0s
=> [1/4] FROM docker.io/library/node@sha256:eee19816ad7ae65dbcac037629c355fa4b369d163a660bc9718df8f945e79eeb 0.0s
=> CACHED [2/4] WORKDIR /app 0.0s
=> CACHED [3/4] COPY . /app 0.0s
=> ERROR [4/4] RUN npm install 0.7s
------
** > [4/4] RUN npm install:
#8 0.673 runc run failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory**
有人可以指导一下吗?
我原本期望这个图片能够被建立。
node
映像,请尝试手动运行docker pull node
然后进行重新构建。我曾经在 Compose 设置中看到过这种情况,即build:
自定义映像,但同时不正确地包括image:
,命名基础映像,这会导致本地覆盖基础映像。 - David Mazed----- 10/7/2020 12:09 PM public -a---- 10/7/2020 12:10 PM 6148 .DS_Store -a---- 1/11/2023 6:26 PM 101 Dockerfile -a---- 10/7/2020 12:09 PM 255 package.json -a---- 10/7/2020 12:09 PM 939 server.js - Hammad Ahmad
Docker version 23.0.0, build e92dd87
,但现在无法构建任何东西。运行任何命令都会出现runc run failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory
的错误提示。我怀疑这是由于更新引起的问题。 - kjpc-tech