Eu não estou conseguindo executar o exemplo do capitulo 3 - Criando e compreendendo imagens. Estou usando Ubuntu 22.04
O build aparentemente rodou ok
cleyton@deepblue:~/docker$ docker build -t cleyton/app-node:4.0 .
Sending build context to Docker daemon 3.172MB Step 1/5 : FROM node:14 ---> 0f2c7f307e4d
Step 2/5 : WORKDIR /app-node ---> Using cache ---> abd4126506f3
Step 3/5 : COPY . . ---> Using cache ---> 6d7475e25591
Step 4/5 : RUN npm install ---> Using cache ---> 75637f10ec55
Step 5/5 : ENTRYPOINT npm start ---> Using cache ---> a818f93e8a69
Successfully built a818f93e8a69
Successfully tagged cleyton/app-node:4.0
mas quando eu rodo a imagem ocorre o erro:
cleyton@deepblue:~/docker$ docker run -p 8080:3000 cleyton/app-node:4.0 npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /app-node/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/app-node/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/logs/2023-01-10T1351_29_196Z-debug.log
cleyton@deepblue:~/docker/app-node$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
outras informações:
cleyton@deepblue:~/docker$ node -v
v18.13.0
cleyton@deepblue:/etc$ docker -v
Docker version 20.10.22, build 3a2c30b
cleyton@deepblue:/etc$ uname -a
Linux deepblue 5.15.0-57-generic #63-Ubuntu SMP Thu Nov 24 13:43:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
(no terminal bash)
cleyton@deepblue:~/docker/app-node$ npm start
volume-exemplo@1.0.0 start node .
Server is listening on port 3000