Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for reading Docker multi-arch images #566

Open
vprakash-seatgeek opened this issue Jun 20, 2023 · 1 comment
Open

Support for reading Docker multi-arch images #566

vprakash-seatgeek opened this issue Jun 20, 2023 · 1 comment

Comments

@vprakash-seatgeek
Copy link

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

Docker supports creating multi-platform images using docker buildx. This generates per-architecture images that are untagged and a manifest list image that points to the others and gets labeled and tagged. The existing docker_registry_image data source is not able to handle these effectively. However, it is useful to be able to query information about the underlying images for cases that do not currently support multi-arch images (AWS Lambda for example).

It seems like the right way to handle this is to create a new data source that handles multi-arch images.

New or Affected Resource(s)

  • docker_registry_multiarch_image - A new data source that allows reading multi-arch images.

Potential Terraform Configuration

data "docker_registry_multiarch_image" "list" {
  name = "alpine:latest"
}

References

  • Support for Docker buildx聽#417 - Somewhat related as these images are created using docker buildx. However, 417 is for the write side and this issue is for the read side.
@vprakash-seatgeek
Copy link
Author

vprakash-seatgeek commented Jun 20, 2023

I have implemented this in #565. If you read the alpine:latest image as in the Potential Terraform Configuration section above, the resulting data object looks like this:

{
  "id" = "library/alpine:latest"
  "insecure_skip_verify" = false
  "manifests" = toset([
    {
      "architecture" = "386"
      "media_type" = "application/vnd.docker.distribution.manifest.v2+json"
      "os" = "linux"
      "sha256_digest" = "sha256:f953af9881ecc0c32d60d9c0438ea2cff465900c4c0fa5601bcc3c996e103cd7"
    },
    {
      "architecture" = "amd64"
      "media_type" = "application/vnd.docker.distribution.manifest.v2+json"
      "os" = "linux"
      "sha256_digest" = "sha256:c0669ef34cdc14332c0f1ab0c2c01acb91d96014b172f1a76f3a39e63d1f0bda"
    },
    {
      "architecture" = "arm"
      "media_type" = "application/vnd.docker.distribution.manifest.v2+json"
      "os" = "linux"
      "sha256_digest" = "sha256:200d1839f0645e5005181b6e6ebd46a040826dec2d6af9320b0f597ec9d27242"
    },
    {
      "architecture" = "arm"
      "media_type" = "application/vnd.docker.distribution.manifest.v2+json"
      "os" = "linux"
      "sha256_digest" = "sha256:2627e55acb9ac183f1c94e6a44f869620d164bbb10d7c42b29df08513eb20c29"
    },
    {
      "architecture" = "arm64"
      "media_type" = "application/vnd.docker.distribution.manifest.v2+json"
      "os" = "linux"
      "sha256_digest" = "sha256:30e6d35703c578ee703230b9dc87ada2ba958c1928615ac8a674fcbbcbb0f281"
    },
    {
      "architecture" = "ppc64le"
      "media_type" = "application/vnd.docker.distribution.manifest.v2+json"
      "os" = "linux"
      "sha256_digest" = "sha256:0d3a7ea444301e2f42df027055f2e272b437bd23a4f117336e0f966ad3ed9bba"
    },
    {
      "architecture" = "s390x"
      "media_type" = "application/vnd.docker.distribution.manifest.v2+json"
      "os" = "linux"
      "sha256_digest" = "sha256:feb7b809e29452823ebb369b4a8333686a179a93746744d6740fae1c0e530e87"
    },
  ])
  "name" = "alpine:latest"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant