[go: up one dir, main page]

Skip to content

Update default devfile to use image digest

MR: Pending

Description

From the discussions here, we are using specific image digest for linux/amd64 in the default_devfile. And we have the issue for fixing this from gitlab-workspace-tools.

After the above issue is resolved, then we could update the code here to use OCI image digest, ee/lib/remote_development/settings/default_settings.rb, and not have to pin specific OS and Arch digest.

Acceptance Criteria

  • Update DEFAULT_DEVFILE to use the OCI image digest
  • verify locally everything works as expected

Notes

Putting some code for how to use docker inspect and/or docker image to display both the OCI-level digest, and the arch-level digests?

For example, we are targeting this OCI image registry.gitlab.com/gitlab-org/gitlab-build-images/workspaces/ubuntu-24.04:20250109224147-golang-1.23

We first pull this image to local

 ~  docker pull registry.gitlab.com/gitlab-org/gitlab-build-images/workspaces/ubuntu-24.04:20250109224147-golang-1.23

Then we could inspect Manifest Digest by using the below command

 ~  docker image inspect --format='{{index .RepoDigests 0}}' registry.gitlab.com/gitlab-org/gitlab-build-images/workspaces/ubuntu-24.04:20250109224147-golang-1.23
registry.gitlab.com/gitlab-org/gitlab-build-images/workspaces/ubuntu-24.04@sha256:bd88180d8cb143ef0f9e400c41060a1170500c5f7737fa4fafd044088a3d119e

Then we could inspect arch-specific digest by using below command

 ~  docker manifest inspect  registry.gitlab.com/gitlab-org/gitlab-build-images/workspaces/ubuntu-24.04:20250109224147-golang-1.23
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.oci.image.index.v1+json",
   "manifests": [
      {
         "mediaType": "application/vnd.oci.image.manifest.v1+json",
         "size": 6872,
         "digest": "sha256:5278a18f31a542bacbb8a2c182df456d3b06321818e71d2d04552f73ab17d0d7",
         "platform": {
            "architecture": "arm64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.oci.image.manifest.v1+json",
         "size": 6872,
         "digest": "sha256:c3d5527641bc0c6f4fbbea4bb36fe225b8e9f1df69f682c927941327312bc676",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.oci.image.manifest.v1+json",
         "size": 566,
         "digest": "sha256:0c3019ef6a51e28713e80f821cd47c1d54bbb5cce7f3c9dcff621b2fbafb9c4a",
         "platform": {
            "architecture": "unknown",
            "os": "unknown"
         }
      },
      {
         "mediaType": "application/vnd.oci.image.manifest.v1+json",
         "size": 566,
         "digest": "sha256:f185132ce5d6fe4b0541bdf411d052260b76610ff4ab3fd221c6a97cdcfa3cf6",
         "platform": {
            "architecture": "unknown",
            "os": "unknown"
         }
      }
   ]
}
Edited by zli