Skip to content

Commit 51b56a3

Browse files
committed
build: make --load use oci exporter with moby containerd store
Signed-off-by: Justin Chadwell <me@jedevc.com>
1 parent 49ccedb commit 51b56a3

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

controller/build/build.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,23 @@ func RunBuild(ctx context.Context, dockerCli command.Cli, in controllerapi.Build
116116
}
117117
}
118118
if in.ExportLoad {
119+
docker := dockerutil.NewClient(dockerCli)
120+
features, err := docker.Features(ctx, "")
121+
if err != nil {
122+
return nil, nil, err
123+
}
119124
if len(outputs) == 0 {
120-
outputs = []client.ExportEntry{{
121-
Type: "docker",
122-
Attrs: map[string]string{},
123-
}}
125+
if features[dockerutil.OCIImporter] {
126+
outputs = []client.ExportEntry{{
127+
Type: "oci",
128+
Attrs: map[string]string{},
129+
}}
130+
} else {
131+
outputs = []client.ExportEntry{{
132+
Type: "docker",
133+
Attrs: map[string]string{},
134+
}}
135+
}
124136
} else {
125137
switch outputs[0].Type {
126138
case "docker":

0 commit comments

Comments
 (0)