get label value from docker inspect [duplicate]

You can use index to get the value of that key (wrapped for readability);

docker inspect \
  --format '{{ index .Config.Labels "com.docker.compose.project"}}' \
  new_sc2_1

That should give you the name of the project

Leave a Comment