Docker Container Does Not Have an IP Address

CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                     PORTS                    NAMES
ca030d3cf1c2        konakart_app                 "/bin/sh -c '/bin/bas"   16 minutes ago      Exited (1) 5 minutes ago                            konakart_app
08909245064b        beantoast/dtkonakart_mysql   "/entrypoint.sh mysql"   54 minutes ago      Up 54 minutes              0.0.0.0:3300->3306/tcp   konakart_db

I am trying to run the konakart application and its database in two different containers. The database seems to be working fine, but the application itself does not seem to have an IP. When I type docker inspect ca03, I get the following:

            "EndpointID": "",
        "Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "",
        "IPPrefixLen": 0,
        "IPv6Gateway": "",
        "MacAddress": "",

Any idea on how to assign my IP address, port 8080 to konakart_app?

+4
source share
2 answers

The reason is simple depending on the result of the result docker ps -athat you placed at the top.

You may have noticed that it shows the status Exited (1) 5 minutes agofor a container with an identifier ca030d3cf1c2. This means that the container is stopped.

, IPAddress. empty docker inspect ca03, .

, IPAddress.

, ​​ , docker-compose.yml. docker run -p <hostport>:<container port>.

, .

+4

, IPAddress Rao, , . , , .

0

Source: https://habr.com/ru/post/1659723/


All Articles