replicate / cog

Containers for machine learning
https://cog.run
Apache License 2.0
8.04k stars 561 forks source link

Cog Build fails with unrecognised --cache-to flag #1883

Open 8W9aG opened 2 months ago

8W9aG commented 2 months ago

Running cog build with the following docker config in a Ubuntu virtual machine:

Client:
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.21.1
 Git commit:        24.0.7-0ubuntu2~22.04.1
 Built:             Wed Mar 13 20:23:54 2024
 OS/Arch:           linux/amd64
 Context:           default

Server:
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.21.1
  Git commit:       24.0.7-0ubuntu2~22.04.1
  Built:            Wed Mar 13 20:23:54 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.12
  GitCommit:        
 runc:
  Version:          1.1.12-0ubuntu2~22.04.1
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:        

Produces the following:

Building Docker image from environment in cog.yaml as cog-xxx...
⚠ Stripping patch version from Python version 3.11.9 to 3.11
⚠ Stripping patch version from Python version 3.11.9 to 3.11
unknown flag: --cache-to
See 'docker --help'.

Ideally this should be worked around to check if docker supports the --cache-to flag.

Nehc commented 2 months ago

same error. any recommendations?

UPD: The problem was that thedocker-buildx-plugin was not installed. It is installed, for example, as described here, in the answers . After that everything works.