I took over a project where a company internal website is running in a Docker container. I did some changes to the code and now whenever I start/restart the container it immediately exits. I assume this is because there is some can of error with the code execution in the Node service inside the container. But how can I fix this if I cannot attach a console to the container to make changes in the code?
Asked
Active
Viewed 244 times
0
-
1Have you tried overriding the entrypoint so you can just get to a shell in the container? `docker run -it --entrypoint sh ...`, for example. – jonrsharpe Jul 23 '21 at 14:02
-
@jonrsharpe Awesome, I start to like docker :) Just create an answer and I'll accept it! – po.pe Jul 23 '21 at 14:14
-
(If the Dockerfile ends with something like `CMD npm run start` and not `ENTRYPOINT`, you can `docker run --rm -it your-image sh` without the `--entrypoint` option.) – David Maze Jul 23 '21 at 14:18
-
Do you have the source code of the app? – JRichardsz Jul 23 '21 at 19:36
-
You mean the node app running inside the container? The problem I currently have is that the solution proposed by @DavidMaze starts a new container, but that one is not up to date. I'm now trying to copy out the probably corrupted files from my container, fix them and move them back in. – po.pe Jul 24 '21 at 05:21