mirror of https://github.com/buildpacks/pack.git
Emit a performance warning if containerd is enabled and we're exporting to the daemon
Signed-off-by: Natalie Arellano <narellano@vmware.com>
This commit is contained in:
parent
be2c8be464
commit
1f7e0c8bcb
|
|
@ -304,6 +304,11 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
|
|||
"Re-run with '--pull-policy=always' to silence this warning.")
|
||||
}
|
||||
|
||||
if !opts.Publish && usesContainerdStorage(c.docker) {
|
||||
c.logger.Warnf("Exporting to docker daemon (building without --publish) and daemon uses containerd storage; performance may be significantly degraded.\n" +
|
||||
"For more information, see https://github.com/buildpacks/pack/issues/2272.")
|
||||
}
|
||||
|
||||
imageRef, err := c.parseReference(opts)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "invalid image name '%s'", opts.Image)
|
||||
|
|
@ -803,6 +808,21 @@ func (c *Client) Build(ctx context.Context, opts BuildOptions) error {
|
|||
return c.logImageNameAndSha(ctx, opts.Publish, imageRef)
|
||||
}
|
||||
|
||||
func usesContainerdStorage(docker DockerClient) bool {
|
||||
info, err := docker.Info(context.Background())
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, driverStatus := range info.DriverStatus {
|
||||
if driverStatus[0] == "driver-type" && driverStatus[1] == "io.containerd.snapshotter.v1" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func getTargetFromBuilder(builderImage imgutil.Image) (*dist.Target, error) {
|
||||
builderOS, err := builderImage.OS()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue