Docker Community Forums

Share and learn in the Docker community.

Can't access container nodejs application from a different machine

i’m using
Ubuntu Desktop 20.04
running on physical machine not VM

My expresss app

var express = require('express')
var app = express()
//Define request response in root URL (/)
app.get('/', function (req, res) {
  res.send('Hello test2!')
//Launch listening server on port 8081
app.listen(8081, function () {
  console.log('app listening2 on port 8081!')

My Dockerfile

FROM node:latest
COPY package.json /app
RUN npm install
COPY . /app
CMD [ "npm", "start" ]

How i run my app

docker run -it --rm -p dockerhubimage

what i can access but its only on a same machine and i can access aswell

My network list

005625396d17        bridge              bridge              local
6cf957bd1639        host                host                local
496bb750ef86        my_bridge           bridge              local
018ebf8845e5        none                null                local

When doing docker inspect bridge

        "Name": "bridge",
        "Id": "005625396d17bcb51fc9cd97ea5cf81aba27165576bd2ec317a5428ec38da4ae",
        "Created": "2020-05-02T07:10:32.712912509+08:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                    "Subnet": "",
                    "Gateway": ""
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        "ConfigOnly": false,
        "Containers": {
            "cf536f1630dbc66579a300127d62e3f116ae107497e4280ca38032cf207d4b05": {
                "Name": "brave_zhukovsky",
                "EndpointID": "da34c73ccada76bad5367a6e0678072b19ad4a398fc2fe3a551e8505a7ed1d9e",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "",
                "IPv6Address": ""
        "Options": {
            "": "true",
            "": "true",
            "": "true",
            "": "",
            "": "docker0",
            "": "1500"
        "Labels": {}


CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                              NAMES
fabeb939d2fb        cariaga/dock        "docker-entrypoint.s…"   23 seconds ago      Up 21 seconds       8080/tcp,>8081/tcp   naughty_bassi

So the problem was i need to access the 192.168… ip NOT the 172.17.0 part which can only be accessed within the same machine while the 192.168. part can be accessed within the local network. :8081