image.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. // Copyright 2018 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.v1beta1.image;
  16. option go_package = "google.golang.org/genproto/googleapis/devtools/containeranalysis/v1beta1/image;image";
  17. option java_multiple_files = true;
  18. option java_package = "io.grafeas.v1beta1.image";
  19. option objc_class_prefix = "GRA";
  20. // Layer holds metadata specific to a layer of a Docker image.
  21. message Layer {
  22. // Instructions from Dockerfile.
  23. enum Directive {
  24. // Default value for unsupported/missing directive.
  25. DIRECTIVE_UNSPECIFIED = 0;
  26. // https://docs.docker.com/engine/reference/builder/
  27. MAINTAINER = 1;
  28. // https://docs.docker.com/engine/reference/builder/
  29. RUN = 2;
  30. // https://docs.docker.com/engine/reference/builder/
  31. CMD = 3;
  32. // https://docs.docker.com/engine/reference/builder/
  33. LABEL = 4;
  34. // https://docs.docker.com/engine/reference/builder/
  35. EXPOSE = 5;
  36. // https://docs.docker.com/engine/reference/builder/
  37. ENV = 6;
  38. // https://docs.docker.com/engine/reference/builder/
  39. ADD = 7;
  40. // https://docs.docker.com/engine/reference/builder/
  41. COPY = 8;
  42. // https://docs.docker.com/engine/reference/builder/
  43. ENTRYPOINT = 9;
  44. // https://docs.docker.com/engine/reference/builder/
  45. VOLUME = 10;
  46. // https://docs.docker.com/engine/reference/builder/
  47. USER = 11;
  48. // https://docs.docker.com/engine/reference/builder/
  49. WORKDIR = 12;
  50. // https://docs.docker.com/engine/reference/builder/
  51. ARG = 13;
  52. // https://docs.docker.com/engine/reference/builder/
  53. ONBUILD = 14;
  54. // https://docs.docker.com/engine/reference/builder/
  55. STOPSIGNAL = 15;
  56. // https://docs.docker.com/engine/reference/builder/
  57. HEALTHCHECK = 16;
  58. // https://docs.docker.com/engine/reference/builder/
  59. SHELL = 17;
  60. }
  61. // Required. The recovered Dockerfile directive used to construct this layer.
  62. Directive directive = 1;
  63. // The recovered arguments to the Dockerfile directive.
  64. string arguments = 2;
  65. }
  66. // A set of properties that uniquely identify a given Docker image.
  67. message Fingerprint {
  68. // Required. The layer ID of the final layer in the Docker image's v1
  69. // representation.
  70. string v1_name = 1;
  71. // Required. The ordered list of v2 blobs that represent a given image.
  72. repeated string v2_blob = 2;
  73. // Output only. The name of the image's v2 blobs computed via:
  74. // [bottom] := v2_blob[bottom]
  75. // [N] := sha256(v2_blob[N] + " " + v2_name[N+1])
  76. // Only the name of the final blob is kept.
  77. string v2_name = 3;
  78. }
  79. // Basis describes the base image portion (Note) of the DockerImage
  80. // relationship. Linked occurrences are derived from this or an
  81. // equivalent image via:
  82. // FROM <Basis.resource_url>
  83. // Or an equivalent reference, e.g. a tag of the resource_url.
  84. message Basis {
  85. // Required. Immutable. The resource_url for the resource representing the
  86. // basis of associated occurrence images.
  87. string resource_url = 1;
  88. // Required. Immutable. The fingerprint of the base image.
  89. Fingerprint fingerprint = 2;
  90. }
  91. // Details of an image occurrence.
  92. message Details {
  93. // Required. Immutable. The child image derived from the base image.
  94. Derived derived_image = 1;
  95. }
  96. // Derived describes the derived image portion (Occurrence) of the DockerImage
  97. // relationship. This image would be produced from a Dockerfile with FROM
  98. // <DockerImage.Basis in attached Note>.
  99. message Derived {
  100. // Required. The fingerprint of the derived image.
  101. Fingerprint fingerprint = 1;
  102. // Output only. The number of layers by which this image differs from the
  103. // associated image basis.
  104. int32 distance = 2;
  105. // This contains layer-specific metadata, if populated it has length
  106. // "distance" and is ordered with [distance] being the layer immediately
  107. // following the base image and [1] being the final layer.
  108. repeated Layer layer_info = 3;
  109. // Output only. This contains the base image URL for the derived image
  110. // occurrence.
  111. string base_resource_url = 4;
  112. }