dockerode icon indicating copy to clipboard operation
dockerode copied to clipboard

List of labels results in map

Open banool opened this issue 3 months ago • 0 comments

When you create a network:

const SHELBY_LOCALNET_NETWORK = "shelby-localnet";
const labels = ["shelby"];

const compose = {
  ...
  networks: {
    [SHELBY_LOCALNET_NETWORK]: {
      name: SHELBY_LOCALNET_NETWORK,
      driver: "bridge",
      labels,
    }
};

The label ends up looking like this:

"Labels": {
  "0": "shelby-localnet",
  "com.docker.compose.network": "default",
  "com.docker.compose.project": "shelby-localnet"
}

The label ending up as the value with a key of "0" is pretty unexpected here, though I'm not an expert in labels with Docker so maybe this is standard.

banool avatar Nov 11 '25 11:11 banool