yes, it’s the container ip address
Here is the result of ip a :
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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
12: eth0@if13: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0
valid_lft forever preferred_lft forever
Here is the result of nc :
# nc -zv 172.17.0.2 31081
Connection to 172.17.0.2 31081 port [tcp/*] succeeded!
Here is the result of curl :
# curl -v -k https://172.17.0.2:31081/MargauPorcinsWs/MargauPService?wsdl
* Trying 172.17.0.2:31081...
* TCP_NODELAY set
* Connected to 172.17.0.2 (172.17.0.2) port 31081 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=sicpa-interop-recette.cati.inrae.fr
* start date: Sep 9 11:52:31 2021 GMT
* expire date: Dec 8 11:52:30 2021 GMT
* issuer: C=US; O=Let's Encrypt; CN=R3
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55ee2f0d5e10)
> GET /MargauPorcinsWs/MargauPService?wsdl HTTP/2
> Host: 172.17.0.2:31081
> user-agent: curl/7.68.0
> accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* Connection state changed (MAX_CONCURRENT_STREAMS == 4294967295)!
< HTTP/2 200
< content-type: text/xml;charset=utf-8
< content-length: 15362
<
<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is Metro/2.4.3.payara-p5 (2.4.3.payara-maintenance-5307578; 2021-04-22T12:36:46+0100) JAXWS-RI/2.3.2.payara-p4 JAXWS-API/2.3.2 JAXB-RI/2.3.2 JAXB-API/2.3.2 git-revision#unknown. --><!-- Generated by JAX-WS RI (https://github.com/eclipse-ee4j/metro-jax-ws). RI's version is Metro/2.4.3.payara-p5 (2.4.3.payara-maintenance-5307578; 2021-04-22T12:36:46+0100) JAXWS-RI/2.3.2.payara-p4 JAXWS-API/2.3.2 JAXB-RI/2.3.2 JAXB-API/2.3.2 git-revision#unknown. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws/" name="MargauPService">
<types>
<xsd:schema>
<xsd:import namespace="http://ws/" schemaLocation="https://172.17.0.2:31081/MargauPorcinsWs/MargauPService?xsd=1"/>
</xsd:schema>
...
...
...
Here is the result of nslookup :
# nslookup forum.payara.fish
Server: 138.102.162.42
Address: 138.102.162.42#53
Non-authoritative answer:
forum.payara.fish canonical name = payara.hosted-by-discourse.com.
Name: payara.hosted-by-discourse.com
Address: 184.104.202.143
Name: payara.hosted-by-discourse.com
Address: 2001:470:1:9a5::143
on my side, I went a little further, I documented myself on docker and I found the docker inspect command which gave me the following result:
[theirman@sicpa-interop-recette ~]$ docker inspect sicpa-interop
[
{
"Id": "90f9bc918462c6f3b015bd6ad3fadbb472e5923dc716bf8b658e695fc0838ecd",
"Created": "2021-10-20T07:37:26.619551487Z",
"Path": "/tini",
"Args": [
"--",
"scripts/entrypoint.sh"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 2873,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-10-20T08:36:23.458986306Z",
"FinishedAt": "2021-10-20T08:36:16.056052027Z"
},
"Image": "sha256:a8080cc0005b5c25a7da1c19cfbb7dc48d49f9ccda80b134802429c7fae56af0",
"ResolvConfPath": "/var/lib/docker/containers/90f9bc918462c6f3b015bd6ad3fadbb472e5923dc716bf8b658e695fc0838ecd/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/90f9bc918462c6f3b015bd6ad3fadbb472e5923dc716bf8b658e695fc0838ecd/hostname",
"HostsPath": "/var/lib/docker/containers/90f9bc918462c6f3b015bd6ad3fadbb472e5923dc716bf8b658e695fc0838ecd/hosts",
"LogPath": "/var/lib/docker/containers/90f9bc918462c6f3b015bd6ad3fadbb472e5923dc716bf8b658e695fc0838ecd/90f9bc918462c6f3b015bd6ad3fadbb472e5923dc716bf8b658e695fc0838ecd-json.log",
"Name": "/sicpa-interop",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/data/apps/payara/autodeploy:/data/apps/payara/autodeploy",
"/data/apps/payara/deployOnBoot:/data/apps/payara/deployOnBoot",
"/etc/letsencrypt:/etc/letsencrypt:ro"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"21801/tcp": [
{
"HostIp": "",
"HostPort": "21081"
}
],
"22081/tcp": [
{
"HostIp": "",
"HostPort": "22081"
}
],
"23081/tcp": [
{
"HostIp": "",
"HostPort": "23081"
}
],
"24081/tcp": [
{
"HostIp": "",
"HostPort": "24081"
}
],
"31801/tcp": [
{
"HostIp": "",
"HostPort": "31081"
}
],
"32081/tcp": [
{
"HostIp": "",
"HostPort": "32081"
}
],
"4848/tcp": [
{
"HostIp": "",
"HostPort": "4848"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"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": [],
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/5362fa76fa867665c4bf8e2366945ebf92a70452261d65fb12901f1081a238e4-init/diff:/var/lib/docker/overlay2/491998dcabb24d2c800144202c6a7f298bab4453ace0f69129922923e6399404/diff:/var/lib/docker/overlay2/f71cfae2dd31d94c848f1d22d41bbb87af6d952b2fa0f3bc4629f7b563159cb4/diff:/var/lib/docker/overlay2/6680d19d1af6ec15ddb43a9d45d93e096395658877359fa674bf6f97ad7c7e42/diff:/var/lib/docker/overlay2/c636507e0a1ad73adaed5c6bd29750a9d9a6382225abbf2c22a58226f6cb035c/diff:/var/lib/docker/overlay2/d5d746ca0ee7cb0dc8ecf93227f50be80167b0d086eb7114d951d776d51331e5/diff",
"MergedDir": "/var/lib/docker/overlay2/5362fa76fa867665c4bf8e2366945ebf92a70452261d65fb12901f1081a238e4/merged",
"UpperDir": "/var/lib/docker/overlay2/5362fa76fa867665c4bf8e2366945ebf92a70452261d65fb12901f1081a238e4/diff",
"WorkDir": "/var/lib/docker/overlay2/5362fa76fa867665c4bf8e2366945ebf92a70452261d65fb12901f1081a238e4/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/data/apps/payara/autodeploy",
"Destination": "/data/apps/payara/autodeploy",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/data/apps/payara/deployOnBoot",
"Destination": "/data/apps/payara/deployOnBoot",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/etc/letsencrypt",
"Destination": "/etc/letsencrypt",
"Mode": "ro",
"RW": false,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "sirec",
"Domainname": "",
"User": "payara",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"21081/tcp": {},
"21801/tcp": {},
"22081/tcp": {},
"23081/tcp": {},
"24081/tcp": {},
"31081/tcp": {},
"31801/tcp": {},
"32081/tcp": {},
"4848/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bin",
"LANG=en_US.UTF-8",
"LANGUAGE=en_US:en",
"LC_ALL=en_US.UTF-8",
"JAVA_HOME=/usr/lib/jvm/zulu11-ca-amd64",
"AS_JAVA=/usr/lib/jvm/zulu11",
"AUTODEPLOY_DIR=/data/apps/payara/autodeploy",
"CONFIG_DIR=/data/apps/payara/config",
"DEPLOY_DIR=/data/apps/payara/deployOnBoot",
"HOME_DIR=/data/apps/payara",
"LOGS_DIR=/data/apps/payara/logs",
"PASSWORD_FILE=/data/apps/payara/passwordFile",
"PAYARA_DIR=/data/apps/payara/appserver",
"SCRIPT_DIR=/data/apps/payara/scripts",
"DOMAIN_NAME=production",
"ADMIN_USER=admin",
"ADMIN_PASSWORD=admin",
"HOSTNAME=sicpa-interop-recette.cati.inrae.fr",
"LE_LIVE=/etc/letsencrypt/live",
"LE_CERT=le_sicpa-interop-recette.cati.inrae.fr",
"JVM_ARGS=",
"DEPLOY_PROPS=",
"POSTBOOT_COMMANDS=/data/apps/payara/config/postboot-commands.asadmin",
"PREBOOT_COMMANDS=/data/apps/payara/config/preboot-commands.asadmin"
],
"Cmd": [
"scripts/entrypoint.sh"
],
"Image": "sicpa-interop",
"Volumes": null,
"WorkingDir": "/data/apps/payara",
"Entrypoint": [
"/tini",
"--"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "a688eff9c03e1e3753c83c282430080e0ecb5292ce045d47d82dd07c0edfb3af",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"21081/tcp": null,
"21801/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "21081"
},
{
"HostIp": "::",
"HostPort": "21081"
}
],
"22081/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "22081"
},
{
"HostIp": "::",
"HostPort": "22081"
}
],
"23081/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "23081"
},
{
"HostIp": "::",
"HostPort": "23081"
}
],
"24081/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "24081"
},
{
"HostIp": "::",
"HostPort": "24081"
}
],
"31081/tcp": null,
"31801/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "31081"
},
{
"HostIp": "::",
"HostPort": "31081"
}
],
"32081/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "32081"
},
{
"HostIp": "::",
"HostPort": "32081"
}
],
"4848/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "4848"
},
{
"HostIp": "::",
"HostPort": "4848"
}
]
},
"SandboxKey": "/var/run/docker/netns/a688eff9c03e",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "7a80ab6b20737ec362e5969832c3f83ba33d7c31507ca1a348bcd80a2e066de0",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "d5d79bfc0793d4305ea419aa4205ba3f9e084a946d0df42a65fe4f998e516059",
"EndpointID": "7a80ab6b20737ec362e5969832c3f83ba33d7c31507ca1a348bcd80a2e066de0",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]
we can see in this trace that port 21081 and 31081 seem to appear twice in the list of NetworkSettings ports, first at null, then with the right values. In fact, if we look closely, these are ports 21081/21801 and 31081/31801. Hence the rejected port!
This is how I used to create my container until now:
docker run -d --name sicpa-interop --hostname sirec -p 4848:4848 -p 21081:21801 -p 22081:22081 -p 23081:23081 -p 24081:24081 -p 31081:31801 -p 32081:32081 -v /etc/letsencrypt:/etc/letsencrypt:ro -v /data/apps/payara/autodeploy:/data/apps/payara/autodeploy -v /data/apps/payara/deployOnBoot:/data/apps/payara/deployOnBoot sicpa-interop
Now I corrected it and everything works perfectly
Thank you @charlee_ch