“docker-compose up -d” is trying to start containers more than once. This is non-fatal (because the second instance fails and exits) but is a bit worrisome.
This appears to be behavior that has begun recently, after an update.
I am running a docker-compose configuration that I’ve had for a while. Nothing in my configuration itself has changed, but I did recently update the OS (Ubuntu 20.04) and all packages, and did fresh pulls on the underlying containers.
What I’m Seeing
Here’s a partial snapshot of what I’m seeing:
brad@stanley:~/nextcloud$ docker-compose up -d
Creating network “nextcloud_nextcloud” with the default driver
Creating network “nextcloud_default” with the default driver
Creating nextcloud-mariadb …
Creating nextcloud-redis …
Creating nextcloud_db_1 … done
Creating nextcloud-coturn …
Creating nextcloud-mariadb … done
Creating nextcloud-redis … done
WARNING: Host is already in use by another container
Creating nextcloud-coturn … error
> f0acd4520d21d4ead2b7a77b942e7c46a5ee70095b964912b5f): Error starting userland proxy: listen tcp 127.0.0.1:9980: bind: address already in use
The process continues, but I’ve snipped the output there. I’ve italicized the error at the bottom.
The reason for the failure appears to be that
- The “nextcloud-coturn” container is being started a second time.
- The first instance of the container is already bound to the socket that it needs, so the second instance fails.
This happens with 3 of my containers in all.
What Appears to be Happening
In general, for each of the three failed second-instance-containers, the second instance appears to be attempting to start 8-10 seconds after the first instance.
I have the “restart” keyword configured to “always” or “unless-stopped” for all my services. I read in the docs that restart detection begins about 10 seconds after launch, so this is consistent with the time delay I’m seeing.
What I’ve Tried
I have searched and searched the docs for a way to lengthen the delay before restart detection commences. I see that it is possible to specify a delay when using the “deploy” keyword, but not when using the simple “restart” keyword.
I have also tried specifying “-t 25” or the like on the docker-compose command line, but it doesn’t make any difference. I’ve also tried the --no-recreate switch, again with no effect.
Thanks for reading. Any tips would be appreciated.