watchtower icon indicating copy to clipboard operation
watchtower copied to clipboard

too many network aliases when recreating the container

Open aogg opened this issue 5 years ago • 3 comments
trafficstars

image

aogg avatar Apr 29 '20 05:04 aogg

Hi there! 👋🏼 As you're new to this repo, we'd like to suggest that you read our code of conduct as well as our contribution guidelines. Thanks a bunch for opening your first issue! 🙏

github-actions[bot] avatar Apr 29 '20 05:04 github-actions[bot]

Hi,

Would you mind expanding on what the issue is and when it occurs?

Thanks, Simme

simskij avatar Apr 29 '20 08:04 simskij

The issue IMHO is that a lot of aliases are accumulating over time (one additional alias per recreate). These are just the container IDs of former instances of this Docker container, which most probably do not serve any purpose, so they could be filtered out when recreating the container.

ginkel avatar May 22 '20 07:05 ginkel

It seems like code from #1699 removes necessary labels added by docker compose. Before restarting:

"Networks": {
      "cartman": {
          "IPAMConfig": null,
          "Links": null,
          "Aliases": [
              "backend",
              "4fcb8f2cd0cf"
          ],
          "NetworkID": "436b4634c942dc7ed8dbc91264b2902f963835297b8e79de174a303c3e512efe",
          "EndpointID": "20200dd70ca0b2d4c78e7382d1fd532b42b3d75d0591aacdc271d01c42c5a812",

After restarting:

 "Networks": {
      "cartman": {
          "IPAMConfig": null,
          "Links": null,
          "Aliases": [
              "8a165377fbb4"
          ],
          "NetworkID": "436b4634c942dc7ed8dbc91264b2902f963835297b8e79de174a303c3e512efe",
          "EndpointID": "e04e0ed1ef91c9c98c1b793172a8983e131d196ad13d1e8ec46b4b8affb61398",

Docker compose added service name backend to container's aliases, but after restarting it's not available anymore.

estromenko avatar Aug 01 '23 15:08 estromenko

That was an oversight, yeah. I think we can deduce from labels what networks are "actual" aliases. A regex could potentially match a valid real alias name...

piksel avatar Aug 03 '23 11:08 piksel