2

I installed docker using snap (during the install process of 22.04) and it was working fine, and all my containers were spun up using docker run ...

This was until I installed docker-compose using apt later on. When I attempted to bring up containers with docker-compose I would get errors stating that the port was already in use.

So I then checked what program/command was using these ports:

sudo lsof -i :9091:
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 1883 root    4u  IPv4  28696      0t0  TCP *:9091 (LISTEN)
docker-pr 1890 root    4u  IPv6  27395      0t0  TCP *:9091 (LISTEN)
sudo netstat -pna | grep 9091
tcp        0      0 0.0.0.0:9091            0.0.0.0:*               LISTEN      1883/docker-proxy
tcp6       0      0 :::9091                 :::*                    LISTEN      1890/docker-proxy

This showed that my container was still somehow running, as the port was in use. However, when running docker ps -a no containers were running...

The commands above all pointed towards docker-proxy, what is this service? Also, why is it so under the radar that docker itself can't even stop the container with commands like: docker rm $(docker ps -aq)? Also, not sure why my container became invisible and was unable to stop it without stopping the docker service entirely.

acran
  • 7,070
  • 1
  • 18
  • 35
hedche
  • 56
  • 4
  • 1
    did you try `docker system prune` ? – Xirehat Dec 29 '22 at 17:51
  • 1
    `docker ps -a no containers were running` so it's not running in a container, or you are not connecting to the dockerd it is running in. See DOCKER_HOST env variable. `The commands above all pointed towards docker-proxy, what is this service?` short google search https://windsock.io/the-docker-proxy/ . Show `ps aux | grep 1890` – KamilCuk Dec 29 '22 at 17:55
  • Hi @KamilCuk, apologies for the vagueness I was frustrated at the time of writing! What I was trying to say is; why does docker-proxy get triggered after I restart the docker service? – hedche Dec 29 '22 at 18:01
  • How many instances of `dockerd` are you running on your host? – BMitch Dec 29 '22 at 18:13
  • @xirehat, I will have to test that. I just spun up a new VM without installing docker using the live installer aka snap – hedche Dec 29 '22 at 18:34
  • @BMitch all I did was install docker with the live installer (snap) then did a `sudo apt install docker-compose` – hedche Dec 29 '22 at 18:35
  • I'm looking for a number, not a description of what you did. 1 instance, 2, more? `ps -ef | grep dockerd` (ignore the grep command in that output). – BMitch Dec 29 '22 at 18:39
  • Is the process running inside a container? i.e. what is the output of `readlink /proc/1890/root` and `readlink /proc/1883/root`? What are the exact command line arguments of the process? Please post the output of `ps aux | grep docker-pr`. `why does docker-proxy get triggered after I restart the docker service?`What is the output of `docker network ls` and maybe `docker network ls | awk 'NF-1{print $1}' | xargs -l docker network inspect`? – KamilCuk Dec 29 '22 at 18:46
  • 1
    Did you manage to install both the standalone Docker Engine and also Docker Desktop? That could result in you running two Docker daemons as @BMitch is suggesting. – David Maze Dec 29 '22 at 18:55

0 Answers0