Compute-Collections: How do I create a collection for a specific Docker LABEL's key-value pair?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compute-Collections: How do I create a collection for a specific Docker LABEL's key-value pair?

L3 Networker

Regarding https://docs.paloaltonetworks.com/prisma/prisma-cloud/22-01/prisma-cloud-compute-edition-admin/confi...

I want to specify a collection of images that have been labeled in the Dockerfile with "LABEL Environment=Development".

However, the docker API returns labels in JSON format.

Using the string wild cards, its easy to imagine...

  • "*Environment*" would collect ALL environments
  • "*Dev" would collect ALL LABELS with Dev anywhere in the LABEL's key or value

But I want a colletion of images labeled "Environment=Development".

 

How do I do that?

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org
1 accepted solution

Accepted Solutions

L3 Networker

Thanks Gary but I already know how to find and read the documentation.  That's why I must query the community.

Rather than specifying the label, Environment=Development, the proper way to specify label, key:value, and of course you can use the wildcards.  The documentation should be updated with a similar description.  So for my case, Environment:Development, is the correct solution.

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org

View solution in original post

2 REPLIES 2

L1 Bithead

Helllo TommyHunt,

 

Have you tried using your label Environment=Development in the Labels section of the collection rule as a pattern to match?

See Pattern Matching here

 

Gary Klimeck | Moderator | Customer Success Engineer | Palo Alto Networks

L3 Networker

Thanks Gary but I already know how to find and read the documentation.  That's why I must query the community.

Rather than specifying the label, Environment=Development, the proper way to specify label, key:value, and of course you can use the wildcards.  The documentation should be updated with a similar description.  So for my case, Environment:Development, is the correct solution.

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org
  • 1 accepted solution
  • 2237 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!