After the construction of the docker. the container is not displayed, why?


I'm trying to build a docker container with If I manually run:

docker run -it node:argon -p 28777:28777 -p 28778:28778 -p 8000:80 /bin/bash

and manually run inside the command which you see in the Dockerfile then everything works perfectly and I am able to log into the service using http.

FROM node:argon


RUN useradd -ms /bin/bash ubuntu

#RUN mkdir /root/ \
#       && touch /root/ \
#       && touch /root/ \
#       && touch /root/

#RUN chmod g+rwx /root/logzio
RUN apt-get update \
        && apt-get install -y vim net-tools

RUN npm install

RUN /node_modules/ &

RUN /node_modules/ &

EXPOSE 28777
EXPOSE 28778

But if I run:

docker build .

The container is created, everything is installed but:

  1. When the creation finishes and I run docker ps -a, the container is not displayed (even though I get it's details when I run docker inspect).
  2. The service is unavailable when I browse to it through http.

Anyone knows what I'm doing wrong?

Docker build does not create a container, it creates an image.

If you do:

docker build -t "myimage:0.1" .

Then do

docker run -it myimage:0.1 -p 28777:28777 -p 28778:28778 -p 8000:80 /bin/bash

it will instantiate a container based on the image you just built.