我有一个
docker-compose.yml
用于构建和运行nodejs web应用程序以及MongoDB实例的文件。
当我在运行
docker-compose up --build
命令失败,出现以下错误。
Digest: sha256:3a09cd85fb4e76f1d5832f9ea1d4e7481f76e807389b7d8ea6ac4d4ba96f83e5
Status: Downloaded newer image for mongo:latest
Starting db
Recreating compose_web_1
ERROR: for web no such image: sha256:1fb4f8e17b47e1fafd29d0f425bf86b934130847ff4b99b055c6757ccaad5bc4: No such image: sha256:1fb4f8e17b47e1fafd29d0f425bf86b934130847ff4b99b055c6757ccaad5bc4
ERROR: Encountered errors while bringing up the project.
尝试的步骤:
-
清理了所有的图像。
-
清洗了所有的容器。
-
起初,我在跑步
docker-compose up
但错误发生后,我正在跑步
docker组装--组装
这一错误的潜在原因可能是什么。
docker撰写。yml
version: '2'
services:
db:
image: mongo:latest
container_name: db
networks:
- todonet
web:
build: ../.
networks:
- todonet
ports:
- "3000"
networks:
todonet:
driver: bridge
目录结构:
âââ app
â  âââ node_modules
â  â  âââ accepts
â  â  âââ async
â  â  â  âââ dist
â  â  â  âââ lib
â  â  âââ basic-auth
â  â  âââ bluebird
â  â  â  âââ js
â  â  â  âââ browser
â  â  â  âââ main
â  â  âââ body-parser
â  â  â  âââ lib
â  â  â  âââ types
â  â  âââ bson
â  â  â  âââ alternate_parsers
â  â  â  âââ browser_build
â  â  â  âââ lib
â  â  â  â  âââ bson
â  â  â  â  âââ parser
â  â  â  âââ tools
â  â  âââ bytes
â  â  âââ cookie
â  â  âââ cookie-parser
â  â  â  âââ lib
â  â  âââ cookie-signature
â  â  âââ core-util-is
â  â  â  âââ lib
â  â  âââ crc
â  â  â  âââ lib
â  â  âââ debug
â  â  âââ depd
â  â  â  âââ lib
â  â  â  âââ compat
â  â  âââ destroy
â  â  âââ ee-first
â  â  âââ ejs
â  â  â  âââ examples
â  â  â  âââ lib
â  â  â  âââ support
â  â  â  âââ test
â  â  â  âââ fixtures
â  â  â  âââ includes
â  â  â  âââ menu
â  â  âââ ejs-locals
â  â  â  âââ example
â  â  â  â  âââ views
â  â  â  âââ node_modules
â  â  â  â  âââ ejs
â  â  â  â  âââ examples
â  â  â  â  âââ lib
â  â  â  â  âââ support
â  â  â  â  âââ test
â  â  â  â  âââ fixtures
â  â  â  â  âââ includes
â  â  â  â  âââ menu
â  â  â  âââ test
â  â  â  âââ fixtures
â  â  â  â  âââ blog
â  â  â  â  â  âââ post
â  â  â  â  âââ path
â  â  â  â  â  âââ to
â  â  â  â  âââ subfolder
â  â  â  â  âââ thing
â  â  â  âââ support
â  â  âââ errorhandler
â  â  â  âââ public
â  â  âââ es6-promise
â  â  â  âââ dist
â  â  â  âââ lib
â  â  â  âââ es6-promise
â  â  â  âââ promise
â  â  âââ escape-html
â  â  âââ etag
â  â  âââ express
â  â  â  âââ lib
â  â  â  â  âââ middleware
â  â  â  â  âââ router
â  â  â  âââ node_modules
â  â  â  âââ depd
â  â  â  âââ lib
â  â  â  âââ compat
â  â  âââ finalhandler
â  â  âââ forwarded
â  â  âââ fresh
â  â  âââ hooks-fixed
â  â  âââ iconv-lite
â  â  â  âââ encodings
â  â  â  â  âââ tables
â  â  â  âââ lib
â  â  âââ inherits
â  â  âââ ipaddr.js
â  â  â  âââ lib
â  â  â  âââ src
â  â  â  âââ test
â  â  âââ isarray
â  â  â  âââ build
â  â  âââ kareem
â  â  â  âââ test
â  â  âââ media-typer
â  â  âââ merge-descriptors
â  â  âââ method-override
â  â  âââ methods
â  â  â  âââ test
â  â  âââ mime
â  â  â  âââ types
â  â  âââ mime-db
â  â  âââ mime-types
â  â  âââ mongodb
â  â  â  âââ lib
â  â  â  âââ bulk
â  â  â  âââ gridfs
â  â  â  âââ gridfs-stream
â  â  âââ mongodb-core
â  â  â  âââ lib
â  â  â  âââ auth
â  â  â  âââ connection
â  â  â  âââ tools
â  â  â  âââ topologies
â  â  â  â  âââ strategies
â  â  â  âââ wireprotocol
â  â  âââ mongoose
â  â  â  âââ examples
â  â  â  â  âââ aggregate
â  â  â  â  âââ express
â  â  â  â  â  âââ connection-sharing
â  â  â  â  âââ geospatial
â  â  â  â  âââ globalschemas
â  â  â  â  âââ lean
â  â  â  â  âââ mapreduce
â  â  â  â  âââ population
â  â  â  â  âââ promises
â  â  â  â  âââ querybuilder
â  â  â  â  âââ replicasets
â  â  â  â  âââ schema
â  â  â  â  â  âââ storing-schemas-as-json
â  â  â  â  âââ statics
â  â  â  âââ lib
â  â  â  â  âââ drivers
â  â  â  â  â  âââ browser
â  â  â  â  â  âââ node-mongodb-native
â  â  â  â  âââ error
â  â  â  â  âââ schema
â  â  â  â  â  âââ operators
â  â  â  â  âââ services
â  â  â  â  âââ types
â  â  â  âââ node_modules
â  â  â  âââ ms
â  â  âââ morgan
â  â  â  âââ node_modules
â  â  â  âââ depd
â  â  â  âââ lib
â  â  â  âââ compat
â  â  âââ mpath
â  â  â  âââ lib
â  â  â  âââ test
â  â  âââ mpromise
â  â  â  âââ lib
â  â  â  âââ test
â  â  âââ mquery
â  â  â  âââ lib
â  â  â  â  âââ collection
â  â  â  âââ node_modules
â  â  â  â  âââ debug
â  â  â  â  âââ ms
â  â  â  â  âââ sliced
â  â  â  â  âââ lib
â  â  â  â  âââ test
â  â  â  âââ test
â  â  â  âââ collection
â  â  âââ ms
â  â  âââ muri
â  â  â  âââ lib
â  â  â  âââ test
â  â  âââ negotiator
â  â  â  âââ lib
â  â  âââ on-finished
â  â  âââ parseurl
â  â  âââ path-to-regexp
â  â  âââ proxy-addr
â  â  âââ qs
â  â  â  âââ lib
â  â  â  âââ test
â  â  âââ range-parser
â  â  âââ raw-body
â  â  âââ readable-stream
â  â  â  âââ lib
â  â  âââ regexp-clone
â  â  â  âââ test
â  â  âââ require_optional
â  â  â  âââ test
â  â  âââ resolve-from
â  â  âââ semver
â  â  â  âââ bin
â  â  â  âââ test
â  â  âââ send
â  â  â  âââ node_modules
â  â  â  âââ depd
â  â  â  âââ lib
â  â  â  âââ compat
â  â  âââ serve-favicon
â  â  âââ serve-static
â  â  âââ sliced
â  â  âââ string_decoder
â  â  âââ type-is
â  â  âââ utils-merge
â  â  âââ vary
â  âââ public
â  â  âââ images
â  â  âââ javascripts
â  â  âââ stylesheets
â  âââ routes
â  âââ views
âââ compose
âââ kubernetes
Dockerfile:
FROM node:slim
LABEL maintainer = "phanikumaryadavilli@gmail.com"
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY ./app/ ./
RUN npm install
CMD ["node", "app.js"]