skip to Main Content

Okay so I am fairly new to the whole Docker and Networks thing, so sorry in advance.

For the last week I experimented with Docker compose and got AdGuard and Jellyfin running and got Homer setup as a dashboard. Now I wanted to add Wireshark, but it gives me this error:

nging: [emerg] bind() to 0.0.0.0:3000 failed (98: Address in use)

I use my old MacBook Pro, Docker Desktop and have my stuff through docker compose files.
From what I’ve tried, finding out what lies on port 3000 and killing it, it’s Docker Desktop itself.

My setup is the following:
I have all my stuff inside VSCode and started it via the docker compuse up -d command.
AdGuard compose file does say 3000:3000/tcp, but I changed it inside the AdGuardHome.yaml to 80, which works.
Homer uses 8080:8080 and Jellyfin the usual 8096:8096.
I tried to use ports 3030:3030 and 3031:3031 for Wireshark, but the log output stays the same with 3000.
I don’t have anything setup on my router nor changed anything inside Docker Desktop.

Can someone help me, what I am doing wrong here? Do I need to change something. I don’t get it.

EDIT:
Here is my docker compose for wireshark:

    ---
    version: "2.1"
    services:
      wireshark:
        image: lscr.io/linuxserver/wireshark:latest
        container_name: wireshark
        cap_add:
          - NET_ADMIN
        security_opt:
          - seccomp:unconfined #optional
        network_mode: host
        environment:
          - PUID=1000
          - PGID=1000
          - TZ=Europe/Berlin
        volumes:
          - mypath:/config
        ports:
          - 3030:3030 #optional
          - 3031:3031 #optional
        restart: unless-stopped

2

Answers


  1. Always try to run a docker-compose down.

    1. Check if port is in use,if so kill the process using that port:
    sudo lsof -i -P -n | grep 3000
    

    then:

     kill -9 <process id>
    
    1. Remove previous containers, try to get a clean build, so run this:
    docker rm -f $(docker ps -aq)
    

    NOTICE: that removes all images.

    Extra: sometimes i had to restart my VM/PC in order to ensure ports are not opened.

    Login or Signup to reply.
  2. You can Check with docker ps command to check which previous service is using the port and stop it.

    One more thing to check is here , The official page of docker hub

    It mention a docker compose example, And you have a mistake with yours. in the ports part

            ports:
              - 3030:3030 #optional
              - 3031:3031 #optional
    

    You don’t have control over the left side of the port, as this is pre configured by the image make that the container will work over port 3000 as mentioned.

    so what you can change is the following :

            ports:
              - {whatever_port_you_want}:3000 #optional
              - {whatever_port_you_want}:3001 #optional
    

    If you wanna change the internal port used by the container, There is an option at the official doc called CUSTOM_PORT, So setting this as environment variables will alter the 3000 default port to what ever you set.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search