Docker IP container instead of HOST IP. Web services request. WAS7 -
i run app webservices on was7 in docker container. when try request endpoint http://172.25.121.54(dockerhost):9080/ufservices/services/ufdocumentserviceendpoint/ get: http://172.18.0.1:9080/ufservices/services/ufdocumentserviceendpoint/ ip form docker network bridge:
$ docker network inspect siecdocker [ { "name": "siecdocker", "id": "49bd1ff621f799fd75eb5237b9384f7c525cb5e7d45015f5b076b5a04e677a83", "created": "2017-09-11t16:17:19.1806053+02:00", "scope": "local", "driver": "bridge", "enableipv6": false, "ipam": { "driver": "default", "options": {}, "config": [ { "subnet": "172.18.0.0/16", "gateway": "172.18.0.1" } ] }, "internal": false, "attachable": false, "ingress": false, "configfrom": { "network": "" }, "configonly": false, "containers": {}, "options": {}, "labels": {} } ]
i tried run container --net=host or static ip, result same.
$ docker run -d --net=host --name mycontainer -p 1521:1521 -p 1522:1522 -p 9080:9080 -p 9043:9043 -p 9060:9060 myimageid $ ip addr on docker host 1: lo: <loopback,up,lower_up> mtu 65536 qdisc noqueue state unknown qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: eth0: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state qlen 1000 link/ether 00:1d:d8:b7:21:90 brd ff:ff:ff:ff:ff:ff inet 172.25.121.54/24 brd 172.25.121.255 scope global eth0 valid_lft forever preferred_lft forever inet 172.25.121.54/22 brd 172.25.123.255 scope global eth0 valid_lft forever preferred_lft forever inet6 fe80::21d:d8ff:feb7:2190/64 scope link valid_lft forever preferred_lft forever 3: docker0: <no-carrier,broadcast,multicast,up> mtu 1500 qdisc noqueue state down link/ether 02:42:c9:e0:bc:23 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 scope global docker0 valid_lft forever preferred_lft forever inet6 fe80::42:c9ff:fee0:bc23/64 scope link valid_lft forever preferred_lft forever 4: br-8dd2c7730da7: <broadcast,multicast> mtu 1500 qdisc noop state down link/ether 02:42:97:86:d7:0c brd ff:ff:ff:ff:ff:ff inet 172.18.0.1/16 scope global br-8dd2c7730da7 valid_lft forever preferred_lft forever 5: br-ce802d519cf0: <broadcast,multicast> mtu 1500 qdisc noop state down link/ether 02:42:7b:03:20:a4 brd ff:ff:ff:ff:ff:ff inet 172.18.0.1/16 scope global br-ce802d519cf0 valid_lft forever preferred_lft forever 50: br-49bd1ff621f7: <no-carrier,broadcast,multicast,up> mtu 1500 qdisc noqueue state down link/ether 02:42:e0:9e:7a:ab brd ff:ff:ff:ff:ff:ff inet 172.18.0.1/16 scope global br-49bd1ff621f7 valid_lft forever preferred_lft forever inet6 fe80::42:e0ff:fe9e:7aab/64 scope link valid_lft forever preferred_lft forever
docker inspect mycontainer:
[ { "id": "801563c785e02550bd4f69cc768cf53829c816fca2c3210d28ab657f92bc1e2e", "created": "2017-09-12t08:01:24.6470979z", "path": "/opt/ibm/websphere/appserver/bin/startserver.sh", "args": [ "server1" ], "state": { "status": "running", "running": true, "paused": false, "restarting": false, "oomkilled": false, "dead": false, "pid": 64056, "exitcode": 0, "error": "", "startedat": "2017-09-12t08:39:23.0578869z", "finishedat": "2017-09-12t08:39:17.3321701z" }, "image": "sha256:170f29ad73e6d24d562dec47f936caf54b9389eb7d0ca22853724942ae696c50", "resolvconfpath": "/var/lib/docker/containers/801563c785e02550bd4f69cc768cf53829c816fca2c3210d28ab657f92bc1e2e/resolv.conf", "hostnamepath": "/var/lib/docker/containers/801563c785e02550bd4f69cc768cf53829c816fca2c3210d28ab657f92bc1e2e/hostname", "hostspath": "/var/lib/docker/containers/801563c785e02550bd4f69cc768cf53829c816fca2c3210d28ab657f92bc1e2e/hosts", "logpath": "/var/lib/docker/containers/801563c785e02550bd4f69cc768cf53829c816fca2c3210d28ab657f92bc1e2e/801563c785e02550bd4f69cc768cf53829c816fca2c3210d28ab657f92bc1e2e-json.log", "name": "/mucontainer", "restartcount": 0, "driver": "overlay", "mountlabel": "", "processlabel": "", "apparmorprofile": "", "execids": null, "hostconfig": { "binds": [ "/opt/docker:/deploy" ], "containeridfile": "", "logconfig": { "type": "json-file", "config": {} }, "networkmode": "host", "portbindings": { "1521/tcp": [ { "hostip": "", "hostport": "1521" } ], "1522/tcp": [ { "hostip": "", "hostport": "1522" } ], "9043/tcp": [ { "hostip": "", "hostport": "9043" } ], "9060/tcp": [ { "hostip": "", "hostport": "9060" } ], "9080/tcp": [ { "hostip": "", "hostport": "9080" } ] }, "restartpolicy": { "name": "no", "maximumretrycount": 0 }, "autoremove": false, "volumedriver": "", "volumesfrom": null, "capadd": null, "capdrop": null, "dns": [], "dnsoptions": [], "dnssearch": [], "extrahosts": null, "groupadd": null, "ipcmode": "", "cgroup": "", "links": null, "oomscoreadj": 0, "pidmode": "", "privileged": false, "publishallports": false, "readonlyrootfs": false, "securityopt": null, "utsmode": "", "usernsmode": "", "shmsize": 67108864, "runtime": "runc", "consolesize": [ 0, 0 ], "isolation": "", "cpushares": 0, "memory": 0, "nanocpus": 0, "cgroupparent": "", "blkioweight": 0, "blkioweightdevice": null, "blkiodevicereadbps": null, "blkiodevicewritebps": null, "blkiodevicereadiops": null, "blkiodevicewriteiops": null, "cpuperiod": 0, "cpuquota": 0, "cpurealtimeperiod": 0, "cpurealtimeruntime": 0, "cpusetcpus": "", "cpusetmems": "", "devices": [], "devicecgrouprules": null, "diskquota": 0, "kernelmemory": 0, "memoryreservation": 0, "memoryswap": 0, "memoryswappiness": -1, "oomkilldisable": false, "pidslimit": 0, "ulimits": null, "cpucount": 0, "cpupercent": 0, "iomaximumiops": 0, "iomaximumbandwidth": 0 }, "graphdriver": { "data": { "lowerdir": "/var/lib/docker/overlay/3d2ed375c0d057e6dee49d0d1e521a2ab6bf8616e87940d3e8ae53346fb155ea/root", "mergeddir": "/var/lib/docker/overlay/51780db78931143df65f04408c0e4c6768a218be8b5ef5e6ea9914c98f15ebdb/merged", "upperdir": "/var/lib/docker/overlay/51780db78931143df65f04408c0e4c6768a218be8b5ef5e6ea9914c98f15ebdb/upper", "workdir": "/var/lib/docker/overlay/51780db78931143df65f04408c0e4c6768a218be8b5ef5e6ea9914c98f15ebdb/work" }, "name": "overlay" }, "mounts": [ { "type": "bind", "source": "/opt/docker", "destination": "/deploy", "mode": "", "rw": true, "propagation": "rprivate" } ], "config": { "hostname": "docker", "domainname": "", "user": "", "attachstdin": false, "attachstdout": false, "attachstderr": false, "exposedports": { "1521/tcp": {}, "1522/tcp": {}, "2809/tcp": {}, "443/tcp": {}, "5060/tcp": {}, "5061/tcp": {}, "5558/tcp": {}, "5578/tcp": {}, "7276/tcp": {}, "7286/tcp": {}, "7777/tcp": {}, "8880/tcp": {}, "9043/tcp": {}, "9060/tcp": {}, "9080/tcp": {}, "9082/tcp": {}, "9100/tcp": {}, "9353/tcp": {}, "9401/tcp": {}, "9402/tcp": {}, "9403/tcp": {}, "9443/tcp": {}, "9633/tcp": {} }, "tty": false, "openstdin": false, "stdinonce": false, "env": [ "path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ], "cmd": null, "image": "172.25.25.66:5000/uf/wasufbos:latest", "volumes": null, "workingdir": "", "entrypoint": [ "/opt/ibm/websphere/appserver/bin/startserver.sh", "server1" ], "onbuild": null, "labels": {} }, "networksettings": { "bridge": "", "sandboxid": "77b4c453bd6adafd8e6dc2ba7b312aedce57f85d3f429216715150c3aafbd7d4", "hairpinmode": false, "linklocalipv6address": "", "linklocalipv6prefixlen": 0, "ports": {}, "sandboxkey": "/var/run/docker/netns/default", "secondaryipaddresses": null, "secondaryipv6addresses": null, "endpointid": "", "gateway": "", "globalipv6address": "", "globalipv6prefixlen": 0, "ipaddress": "", "ipprefixlen": 0, "ipv6gateway": "", "macaddress": "", "networks": { "host": { "ipamconfig": null, "links": null, "aliases": null, "networkid": "4a7500c8681a70f1ea3779b6f64723144dcc49c365f96ce21dea8c1bd5af5172", "endpointid": "e5c55f584d19be55f2aee5dd6f5e831696d3063ff14d85742e95d28fc1a18cda", "gateway": "", "ipaddress": "", "ipprefixlen": 0, "ipv6gateway": "", "globalipv6address": "", "globalipv6prefixlen": 0, "macaddress": "", "driveropts": null } } } } ]
docker version 17.06.0-ce, build 02c1d87
linux centos7 localhost.localdomain 3.10.0-514.el7.x86_64 #1 smp tue nov 22 16:42:41 utc 2016 x86_64 x86_64 x86_64 gnu/linux
Comments
Post a Comment