-2

Tenho um problema com o Docker volumes, no meu primeiro projeto deu tudo certo agora em outro tenho esse erro, quando vou rodar novamente o 1 projeto funciona quando vo. Para outro da esse erro. Estou usado wsl2 no Windows 10

Já fui nessa pasta. Apaguei, mesmo assim acontece o erro.

\\wsl$\docker-desktop-data\version-pack-data\community\docker
executor failed running [/bin/sh -c npm install]: exit code: 1
ERROR: Service 'app' failed to build : Build failed
  • dockerfile
FROM node:alpine

WORKDIR /usr/app

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 3333

CMD ["npm", "run", "dev"]

  • docker-compose
version: '3.7'

services:
  postgres_bd:
    image: postgres
    container_name: user
    ports:
      - 5432:5432
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=docker
      - POSTGRES_DB=cadastro-de-usuarios
    volumes:
      - pgdata:/data/postgres

  mongo_db:
    image: mongo
    container_name: notification
    ports:
      - 27017:27017
    environment:
      - MONGO_INITDB_ROOT_USERNAME=mongo
      - MONGO_INITDB_ROOT_PASSWORD=docker
      - MONGO_INITDB_DATABASE=cadastro-e-login
    volumes:
      - ./mgdata:/var/lib/data/mongodb

  app:
    build: .
    container_name: node
    ports:
      - 3333:3333
    volumes:
      - .:/usr/app
    depends_on:
      - postgres_bd
      - mongo_db

volumes:
  pgdata:
    driver: local
  • log
Building app
[+] Building 84.1s (8/9)
 => [internal] load build definition from Dockerfile                                                               0.1s 
 => => transferring dockerfile: 176B                                                                               0.1s 
 => [internal] load .dockerignore                                                                                  0.1s 
 => => transferring context: 69B                                                                                   0.0s 
 => [internal] load metadata for docker.io/library/node:alpine                                                    25.4s 
 => [1/5] FROM docker.io/library/node:alpine@sha256:1ee1478ef46a53fc0584729999a0570cf2fb174fbfe0370edbf09680b237  16.4s 
 => => resolve docker.io/library/node:alpine@sha256:1ee1478ef46a53fc0584729999a0570cf2fb174fbfe0370edbf09680b2378  0.1s 
 => => sha256:540db60ca9383eac9e418f78490994d0af424aab7bf6d0e47ac8ed4e2e9bcbba 2.81MB / 2.81MB                     0.9s 
 => => sha256:2ccfc847721bd5a61efe0179179ab9944724f4742ec73aed54e9cc9e440b15e0 35.46MB / 35.46MB                   5.8s 
 => => sha256:1ee1478ef46a53fc0584729999a0570cf2fb174fbfe0370edbf09680b2378b56 1.43kB / 1.43kB                     0.0s 
 => => sha256:65ccf08f9e0e15861e1d241ff90aeb293d86e080b68b5053b888ee38db887289 1.16kB / 1.16kB                     0.0s 
 => => sha256:d2adab47ce8f2b64403ec60f6d543d3b5cb8e114a28887f5a66fa4386938664a 6.53kB / 6.53kB                     0.0s 
 => => sha256:0fb557f738857421ec65b07c40ff8443578c7ffd7baffcff0182a4244890eb01 2.35MB / 2.35MB                     1.4s 
 => => extracting sha256:540db60ca9383eac9e418f78490994d0af424aab7bf6d0e47ac8ed4e2e9bcbba                          0.6s 
 => => sha256:2816020507ac6142dd6ae22622faa1440017048a9ad17864ecf6c253b0449c28 281B / 281B                         1.6s 
 => => extracting sha256:2ccfc847721bd5a61efe0179179ab9944724f4742ec73aed54e9cc9e440b15e0                          3.4s 
 => => extracting sha256:0fb557f738857421ec65b07c40ff8443578c7ffd7baffcff0182a4244890eb01                          0.3s 
 => => extracting sha256:2816020507ac6142dd6ae22622faa1440017048a9ad17864ecf6c253b0449c28                          0.0s 
 => [internal] load build context                                                                                  0.5s 
 => => transferring context: 472.51kB                                                                              0.4s 
 => [2/5] WORKDIR /usr/app                                                                                         2.4s 
 => [3/5] COPY package.json ./                                                                                     1.4s 
 => ERROR [4/5] RUN npm install                                                                                   37.8s 
------
 > [4/5] RUN npm install:
#8 36.16 npm notice
#8 36.16 npm notice New patch version of npm available! 7.21.0 -> 7.21.1
#8 36.16 npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.21.1>
#8 36.16 npm notice Run `npm install -g [email protected]` to update!
#8 36.16 npm notice
#8 36.16 npm ERR! code ERESOLVE
#8 36.17 npm ERR! ERESOLVE unable to resolve dependency tree
#8 36.17 npm ERR!
#8 36.17 npm ERR! While resolving: [email protected]
#8 36.17 npm ERR! Found: [email protected]
#8 36.17 npm ERR! node_modules/eslint
#8 36.17 npm ERR!   dev eslint@"^5.16.0" from the root project
#8 36.17 npm ERR!
#8 36.17 npm ERR! Could not resolve dependency:
#8 36.17 npm ERR! peer eslint@">=7.0.0" from [email protected]
#8 36.17 npm ERR! node_modules/eslint-config-prettier
#8 36.17 npm ERR!   dev eslint-config-prettier@"^8.3.0" from the root project
#8 36.17 npm ERR!
#8 36.17 npm ERR! Fix the upstream dependency conflict, or retry
#8 36.17 npm ERR! this command with --force, or --legacy-peer-deps
#8 36.17 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
#8 36.17 npm ERR!
#8 36.18 npm ERR! See /root/.npm/eresolve-report.txt for a full report.
#8 36.30
#8 36.30 npm ERR! A complete log of this run can be found in:
#8 36.30 npm ERR!     /root/.npm/_logs/2021-08-27T18_48_11_257Z-debug.log
------
executor failed running [/bin/sh -c npm install]: exit code: 1
ERROR: Service 'app' failed to build : Build failed
9
  • O que tem no log de erro? Você já tentou trocar a porta? 3333 por outra?
    – JhowBhz
    Commented 27/08/2021 às 19:02
  • Não, mas to nesse problema des de ontem ou seja ja desliguei o pc se tivesse usando a porta hj não daria o msm erro to achando que e arquivo dando conflito
    – mumu
    Commented 27/08/2021 às 19:04
  • Poderia postar o log?
    – JhowBhz
    Commented 27/08/2021 às 19:08
  • 1
    adicionar no dockerfile?
    – mumu
    Commented 27/08/2021 às 19:16
  • 1
    se for eu ja fiz e deu o mesmo erro isso sem falar que a versão alpine vem sem o sudo.
    – mumu
    Commented 27/08/2021 às 19:18

1 Resposta 1

-1

O problema tava na versão do node que tava quebrando aplicação na versão mais recente.

FROM node:14

WORKDIR /usr/api/authentication

COPY package.json ./

RUN npm install

EXPOSE 3333

CMD ["npm", "run", "dev"]

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .