You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker tag 'mcr.microsoft.com/windows/servercore:ltsc2022@sha256:d4ab2dd7d3d0fce6edc5df459565a4c96bbb1d0148065b215ab5ddcab1e42eb4''mcr.microsoft.com/windows/servercore:ltsc2022'
# TODO this needs to be based on the *host* architecture, not the *target* architecture (amd64 vs i386)
35
+
|index($arch)
36
+
|not
37
+
# TODO "failed to read dockerfile: failed to load cache key: subdir not supported yet" asdflkjalksdjfklasdjfklajsdklfjasdklgfnlkasdfgbhnkljasdhgouiahsdoifjnask,.dfgnklasdbngoikasdhfoiasjdklfjasdlkfjalksdjfkladshjflikashdbgiohasdfgiohnaskldfjhnlkasdhfnklasdhglkahsdlfkjasdlkfjadsklfjsdl (hence "tianon/buildkit" instead of "moby/buildkit"; need *all* the arches we care about/support for consistent support)
38
+
)
31
39
)
32
-
# TODO "failed to read dockerfile: failed to load cache key: subdir not supported yet" asdflkjalksdjfklasdjfklajsdklfjasdklgfnlkasdfgbhnkljasdhgouiahsdoifjnask,.dfgnklasdbngoikasdhfoiasjdklfjasdlkfjalksdjfkladshjflikashdbgiohasdfgiohnaskldfjhnlkasdhfnklasdhglkahsdlfkjasdlkfjadsklfjsdl (hence "tianon/buildkit" instead of "moby/buildkit")
33
40
;
34
41
# input: "build" object (with "buildId" top level key)
35
42
# output: string "pull command" ("docker pull ..."), may be multiple lines, expects to run in Bash with "set -Eeuo pipefail", might be empty
@@ -71,66 +78,110 @@ def git_build_url:
71
78
) +"#"+.GitCommit+":"+.Directory
72
79
;
73
80
# input: "build" object (with "buildId" top level key)
# TODO EXPERIMENTAL_BUILDKIT_SOURCE_POLICY=<(jq ...)
84
136
"docker buildx build --progress=plain",
85
-
ifshould_use_docker_buildx_driverthen"--load"else# TODO if we get containerd integration and thus use "--load" unconditionally again, we should update this to still set annotations! (and still gate SBOMs on appropriate scanner-supported architectures)
137
+
if$supportsAnnotationsAndAttestsationsthen
86
138
"--provenance=mode=max",
87
139
# see "bashbrew remote arches docker/scout-sbom-indexer:1" (we need the SBOM scanner to be runnable on the host architecture)
# TODO this should also be totally optional -- for example, Tianon doesn't want SBOMs on his personal images
92
145
elseemptyend,
93
-
(
94
-
"--output "+ (
95
-
[
96
-
"type=oci", # TODO find a better way to build/tag with a full list of tags but only actually *push* to one of them so we don't have to round-trip through containerd
97
-
"dest=temp.tar", # TODO choose/find a good "safe" place to put this (temporarily)
# TODO come up with less assuming values here? (Docker Hub assumption, tag ordering assumption)
105
-
"org.opencontainers.image.version": ( # value of the first image tag
106
-
first(.source.allTags[] |select(contains(":")))
107
-
|sub("^.*:"; "")
108
-
# TODO maybe we should do the first, longest, non-latest tag instead of just the first tag?
109
-
),
110
-
"org.opencontainers.image.url": ( # URL to Docker Hub
111
-
first(.source.allTags[] |select(contains(":")))
112
-
|sub(":.*$"; "")
113
-
|ifcontains("/") then
114
-
"r/"+.
115
-
else
116
-
"_/"+.
117
-
end
118
-
|"https://hub.docker.com/"+.
119
-
),
120
-
# TODO org.opencontainers.image.vendor ? (feels leaky to put "Docker Official Images" here when this is all otherwise mostly generic)
121
-
}
122
-
|to_entries[] |select(.value!=null) |
123
-
"annotation."+.key+"="+.value,
124
-
"annotation-manifest-descriptor."+.key+"="+.value
125
-
),
126
-
empty
127
-
]
128
-
|@csv
129
-
|@sh
130
-
)
131
-
),
132
146
empty
133
-
end,
147
+
elseemptyend,
148
+
"--output "+ (
149
+
[
150
+
ifshould_use_docker_buildx_driverthen
151
+
"type=docker"
152
+
else
153
+
"type=oci",
154
+
"dest=temp.tar", # TODO choose/find a good "safe" place to put this (temporarily)
155
+
empty
156
+
end,
157
+
empty
158
+
]
159
+
|@csv
160
+
|@sh
161
+
),
162
+
(
163
+
if$supportsAnnotationsAndAttestsationsthen
164
+
build_annotations($buildUrl)
165
+
|to_entries
166
+
# separate loops so that "image manifest" annotations are grouped separate from the index/descriptor annotations (easier to read)
167
+
| (
168
+
.[]
169
+
|@sh"--annotation \(.key+"="+.value)"
170
+
),
171
+
(
172
+
.[]
173
+
|@sh"--annotation \(
174
+
"manifest-descriptor:"+.key+"="
175
+
+if.key=="org.opencontainers.image.created"then
176
+
# the "current" time breaks reproducibility (for the purposes of build verification), so we put "now" in the image index but "SOURCE_DATE_EPOCH" in the image manifest (which is the thing we'd ideally like to have reproducible, eventually)
0 commit comments