Guides
Using Gameye
Using container labels
4min
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 { "id" "this is my unique id", "location" "amsterdam test", "image" "nginx", "env" {}, "args" \[], "restart" true, "labels" { "org opencontainers image ref name" "ubuntu", "org opencontainers image version" "18 04" } } we have a few standard labels 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 { "sessions" \[ 	 { 	 "id" "this is my unique id", 	 "location" "amsterdam test", 	 "image" "nginx", 	 "host" "23 11 111 111", 	 "created" 1678710749000, 	 "port" { 	 "80/tcp" 33950 	 }, 	 "labels" { 	 "env" "{\\"gameye session id\\" \\"letstestitalright123\\",\\"gameye host\\" \\"23 11 111 111\\",\\"gameye port tcp 80\\" \\"33950\\"}", 	 "gameye" "{\\"organization\\" \\"myorg\\",\\"session\\" \\"this is my unique id\\",\\"image\\" \\"nginx\\",\\"region\\" \\"amsterdam test\\",\\"tag\\" \\"1 23\\",\\"enablemetrics\\" \\"false\\"}", 	 "maintainer" "nginx docker maintainers \<docker maint\@nginx com>", 	 "tags" "{\\"org opencontainers image ref name\\" \\"ubuntu\\",\\"org opencontainers image version\\" \\"18 04\\"}" 	 }, 	 "enablemetrics" false 	 } 	 ] } images can create labels, too the image itself can also pass down labels when you create it as a container if we look at the dockerfile https //github com/nginxinc/docker nginx/blob/5ce65c3efd395ee2d82d32670f233140e92dba99/mainline/debian/dockerfile of nginx, we can clearly see this label maintainer="nginx docker maintainers \<docker maint\@nginx com>" our api then returns "maintainer" "nginx docker maintainers \<dockermaint\@nginx com>", using our api with labels 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