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
// TODO use "meta.StageNames" to do "docker build --target" so we can tag intermediate stages too for cache (streaming "git archive" directly to "docker build" makes that a little hard to accomplish without re-streaming)
// TODO use "meta.StageNames" to do "docker build --target" so we can tag intermediate stages too for cache (streaming "git archive" directly to "docker build" makes that a little hard to accomplish without re-streaming)
// thanks to https://github.com/Azure/image-rootfs-scanner/blob/e7041e47d1a13e15d73d9c85644542e6758f9f3a/containerd.go#L42-L87 for inspiring this magic
// set-but-empty environment variable means use default explicitly
53
+
ns=env
54
+
}
55
+
break
56
+
}
57
+
}
58
+
ctx=namespaces.WithNamespace(ctx, ns)
59
+
60
+
ifcontainerdClientCache!=nil {
61
+
returnctx, containerdClientCache, nil
62
+
}
63
+
64
+
for_, envKey:=range []string{
65
+
`BASHBREW_CONTAINERD_CONTENT_ADDRESS`, // TODO if we ever need to connnect to a containerd instance for something more interesting like running containers, we need to have *that* codepath not use _CONTENT_ variants
66
+
`BASHBREW_CONTAINERD_ADDRESS`,
67
+
`CONTAINERD_CONTENT_ADDRESS`,
68
+
`CONTAINERD_ADDRESS`,
69
+
} {
70
+
ifsocket, ok:=os.LookupEnv(envKey); ok {
71
+
ifsocket=="" {
72
+
// we'll use a set-but-empty variable as an explicit request to use our built-in implementation
73
+
break
74
+
}
75
+
client, err:=containerd.New(socket)
76
+
containerdClientCache=client
77
+
returnctx, client, err
78
+
}
79
+
}
80
+
81
+
// if we don't have an explicit variable asking us to connect to an existing containerd instance, we set up and use our own in-process content/image store
0 commit comments