Thanks in advance. I am new to docker, My current project is to deploy the MEAN stack application on different containers. The first container has a Mongo image, second container has a node image and the third container has an angular image. When I am trying to build a node container, it is creating a container but automatically its getting deleted. I don’t know why? Could anyone help me out?
When building images, docker actually run them and save the final state in the image. Yet, containers rund by docker while building images are always short lived (the time to build the image).
Once the image is ready, start a container using that final image. This one shoud stay up. Or you have a bug in your image/entrypoint/CMD line. Have a look at the container’s log to figue this out
You seem to be mixing up terms. You don’t build a container, you build an image. I assume you are not talking about images, but rather are trying to start a Node container and it is immediately exiting. This is expected because Node is expecting an app to run and without an app it simply exits.
Angular runs on Node so they should be in the same container (and I’m guessing that your Angular container already has Node installed). So instead of having a Node container and an Angular container you just need an Angular container running Node.