Using container labels
A label is a form of metadata on your container. It comes in the form of a key and value pair.
When you start a container on a machine, you can add multiple labels to the container. But it’s worth noting that they’re static and last throughout the container’s lifetime, which means you can’t change the labels once the container is running.
Learn more about labels. For more information about how labels work with Docker, check out their website.
With our orchestrator, you can pass down a collection of labels to a container through a labels object.
Your custom labels aren’t the only ones our orchestrator passes down to the container. We also include some metadata that anyone with list access can use.
The image itself can also pass down labels when you create it as a container.
If we look at the Dockerfile of nginx, we can clearly see this:
LABEL maintainer="NGINX Docker Maintainers <[email protected]>"
Our API then returns:
"maintainer": "NGINX Docker Maintainers <[email protected]>",.
Within the labels object, all:
- Environment variables are JSON packed inside an env field
- Gameye-defined labels are JSON packed inside a gameye field
- User-defined labels are JSON packed inside a tags field.
Our API lets you filter the list of sessions using the OpenAPI deepObject style:
https://api.gameye.io/session?filter[org.opencontainers.image.ref.name]=ubuntu
We only support equality comparisons right now. That means the API can’t filter based on other criteria, like whether the value of a label starts with X or Y. Equality comparisons are also case-sensitive.