Hi guys,
I’m new to using Docker.
I create an Ubuntu server on my local network for studies, install Docker on this server, and use a Docker Compose file to run a Sonatype Nexus Repository Community Edition container.
docker-compose.yml
services:
sonatype-nexus3:
image: sonatype/nexus3:latest
restart: always
privileged: true
ports:
- 0.0.0.0:30000:8081
healthcheck:
test: ["CMD", "curl", "-f", "-s", "http://localhost:8081/service/rest/v1/status/writable"]
interval: 1s
timeout: 5s
retries: 10
start_period: 60s
volumes:
- ./data:/nexus-data
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2b63c8a484f7 sonatype/nexus3:latest "/opt/sonatype/nexus…" 35 minutes ago Up About a minute (healthy) 0.0.0.0:30000->8081/tcp sonatype-sonatype-nexus3-1
Access the container on ubuntu:
Access the container on the other machine
This site can’t be reached
http://192.168.0.201:30000/ is unreachable.
ERR_ADDRESS_UNREACHABLE
Another container (works fine)
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
930f7e030817 postgres:latest "docker-entrypoint.s…" 10 days ago Up 2 days (healthy) 0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp postgres-postgres-1
docker-compose.yml
services:
postgres:
image: postgres:latest
restart: always
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: 5s
retries: 10
start_period: 60s
environment:
PGUSER: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
secrets:
- db_password
volumes:
- ./data:/var/lib/postgresql/data
- ./scripts:/docker-entrypoint-initdb.d
secrets:
db_password:
file: ./POSTGRES_PASSWORD
Ubuntu server firewall:
sudo ufw status
Status: inactive
Ubuntu netstat
netstat -tulnp | grep 30000
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:30000 0.0.0.0:* LISTEN -
Other machine in the same network
ping 192.168.0.201
PING 192.168.0.201 (192.168.0.201): 56 data bytes
64 bytes from 192.168.0.201: icmp_seq=0 ttl=64 time=62.250 ms
64 bytes from 192.168.0.201: icmp_seq=1 ttl=64 time=5.392 ms
64 bytes from 192.168.0.201: icmp_seq=2 ttl=64 time=91.923 ms
64 bytes from 192.168.0.201: icmp_seq=3 ttl=64 time=9.409 ms
64 bytes from 192.168.0.201: icmp_seq=4 ttl=64 time=6.420 ms
64 bytes from 192.168.0.201: icmp_seq=5 ttl=64 time=56.084 ms
64 bytes from 192.168.0.201: icmp_seq=6 ttl=64 time=18.022 ms
64 bytes from 192.168.0.201: icmp_seq=7 ttl=64 time=92.921 ms
64 bytes from 192.168.0.201: icmp_seq=8 ttl=64 time=7.174 ms
64 bytes from 192.168.0.201: icmp_seq=9 ttl=64 time=8.809 ms
64 bytes from 192.168.0.201: icmp_seq=10 ttl=64 time=99.095 ms
64 bytes from 192.168.0.201: icmp_seq=11 ttl=64 time=72.728 ms
nc -vnzu 192.168.0.201 30000
Connection to 192.168.0.201 port 30000 [udp/*] succeeded!
Any advice or recommendation to solve this problem?
It’s a Docker or Ubuntu issue?
Thanks in advance for your help.