Could not bind socket: Address already in use

I’m using port 8082 in dockerfile:

ENV FILESERVER_PORT 8082

When starting seafile with:

sudo bash /opt/seafile/seafile-server-6.3.4/seafile.sh start

I get the error http-server.c(2197): Could not bind socket: Address already in use

I tried to delete ccnet.sock and starting docker again. That didn’t help.

Netstat is showing:

tcp6 0 0 :::8082 :::* LISTEN 4993/docker-proxy
tcp6 0 0 :::8090 :::* LISTEN 5321/docker-proxy
tcp6 0 0 :::8000 :::* LISTEN 5007/docker-proxy
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 899/mysqld

sudo docker ps:

sudo docker ps:

#####:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
############ mdh_seafile "/bin/sh -c 'bash /s…" 23 minutes ago Up 3 minutes 0.0.0.0:8000->8000/tcp, 0.0.0.0:8082->8082/tcp mdh_seafile_1_f2341d904d27
############ mdh_owncloud "/bin/sh -c 'bash /s…" 22 hours ago Up 3 minutes 0.0.0.0:8090->80/tcp mdh_owncloud_1_260c3a56f2a5
############ mysql "docker-entrypoint.s…" 26 hours ago Up 3 minutes 3306/tcp, 33060/tcp mdh_db_1_46bebe733124

I tried changing the port in docker-compose from:

ports:
    - "8000:8000"
    - "8082:8082

to

ports:
    - "8001:8001"
    - "8083:8083

But it just told me the same.

Also netstat shows just one output:

sudo netstat -pna | grep 8082
tcp6 0 0 :::8082 :::* LISTEN 19685/docker-proxy