kreuzwerker/terraform-provider-docker

Docker Container List data source

KetchupBomb opened this issue ยท 0 comments

Community Note

  • Please vote on this issue by adding a ๐Ÿ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Looking for a data source for listing containers. Specifically, the /containers Docker Engine API endpoint.

New or Affected Resource(s)

  • New data docker_containers

Potential Terraform Configuration

data "docker_containers" "this" {}
ouput "container_fingerprint" {
  description = "Toy example mapping Container IDs to an md5sum fingerprint of its configuration"
  value       = { for c in data.docker_containers.this : c.ID => md5(jsonencode(c)) }
}

References

Thanks for this Provider!

I couldn't find any issues that seemed to match the need for listing containers for enumeration, which I'm surprised by. Sorry if I missed a relevant existing issue.

I am a Golang noob, and I've never written a Terraform Provider before, but this might be a good place for me to cut my teeth. Wanted to flag it for consideration to see if this has already been discussed as a Won't Do or something.

Thanks for your consideration