image.proto 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Copyright 2019 The Grafeas Authors. All rights reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package grafeas.v1;
  16. option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas";
  17. option java_multiple_files = true;
  18. option java_package = "io.grafeas.v1";
  19. option objc_class_prefix = "GRA";
  20. // Layer holds metadata specific to a layer of a Docker image.
  21. message Layer {
  22. // Required. The recovered Dockerfile directive used to construct this layer.
  23. // See https://docs.docker.com/engine/reference/builder/ for more information.
  24. string directive = 1;
  25. // The recovered arguments to the Dockerfile directive.
  26. string arguments = 2;
  27. }
  28. // A set of properties that uniquely identify a given Docker image.
  29. message Fingerprint {
  30. // Required. The layer ID of the final layer in the Docker image's v1
  31. // representation.
  32. string v1_name = 1;
  33. // Required. The ordered list of v2 blobs that represent a given image.
  34. repeated string v2_blob = 2;
  35. // Output only. The name of the image's v2 blobs computed via:
  36. // [bottom] := v2_blob[bottom]
  37. // [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
  38. // Only the name of the final blob is kept.
  39. string v2_name = 3;
  40. }
  41. // Basis describes the base image portion (Note) of the DockerImage
  42. // relationship. Linked occurrences are derived from this or an equivalent image
  43. // via:
  44. // FROM <Basis.resource_url>
  45. // Or an equivalent reference, e.g., a tag of the resource_url.
  46. message ImageNote {
  47. // Required. Immutable. The resource_url for the resource representing the
  48. // basis of associated occurrence images.
  49. string resource_url = 1;
  50. // Required. Immutable. The fingerprint of the base image.
  51. Fingerprint fingerprint = 2;
  52. }
  53. // Details of the derived image portion of the DockerImage relationship. This
  54. // image would be produced from a Dockerfile with FROM <DockerImage.Basis in
  55. // attached Note>.
  56. message ImageOccurrence {
  57. // Required. The fingerprint of the derived image.
  58. Fingerprint fingerprint = 1;
  59. // Output only. The number of layers by which this image differs from the
  60. // associated image basis.
  61. int32 distance = 2;
  62. // This contains layer-specific metadata, if populated it has length
  63. // "distance" and is ordered with [distance] being the layer immediately
  64. // following the base image and [1] being the final layer.
  65. repeated Layer layer_info = 3;
  66. // Output only. This contains the base image URL for the derived image
  67. // occurrence.
  68. string base_resource_url = 4;
  69. }