cog icon indicating copy to clipboard operation
cog copied to clipboard

Getting unknown flag: --platform

Open cs-mshah opened this issue 1 year ago • 8 comments

I am running cog on mac, using colima and also have installed buildx with brew install docker-buildx. But upon running cog run python, I get the following error: unknown flag: --platform. Can you help fix this?

cs-mshah avatar Nov 17 '23 09:11 cs-mshah

@cs-mshah I can't reproduce this locally, but it sounds like you might be using an old version of BuildKit. Can you share the outputs of the following commands?

docker version
docker buildx version

mattt avatar Nov 17 '23 11:11 mattt

Output of docker version:

docker version
Client: Docker Engine - Community
 Version:           24.0.5
 API version:       1.42 (downgraded from 1.43)
 Go version:        go1.20.6
 Git commit:        ced0996600
 Built:             Wed Jul 19 19:44:22 2023
 OS/Arch:           darwin/arm64
 Context:           colima

Server:
 Engine:
  Version:          23.0.6
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       9dbdbd4b6d7681bd18c897a6ba0376073c2a72ff
  Built:            Fri May 12 13:54:36 2023
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v1.7.0
  GitCommit:        1fbd70374134b891f97ce19c70b6e50c7b9f4e0d
 runc:
  Version:          1.1.7
  GitCommit:        860f061b76bb4fc671f0f9e900f7d80ff93d4eb7
 docker-init:
  Version:          0.19.0
  GitCommit:

docker buildx version docker: 'buildx' is not a docker command.

But I did install docker buildx using brew install docker-buildx

cs-mshah avatar Nov 18 '23 05:11 cs-mshah

@cs-mshah It could be that your PATH is configured to use something other than what Homebrew installed.

Could you try the following?

$ which docker

If that includes /opt/homebrew or /usr/local/bin, then you are running the Homebrew command.

In which, case you might try uninstalling docker-buildx and installing docker:

$ brew uninstall docker-buildx
$ brew install docker

mattt avatar Nov 20 '23 12:11 mattt

The issue still persists.

cs-mshah avatar Nov 22 '23 15:11 cs-mshah

I am getting this same issue.

michaelevensen avatar Nov 30 '23 13:11 michaelevensen

@michaelevensen you should have docker buildx plugin

https://stackoverflow.com/questions/75452542/how-to-install-buildx-with-docker-23-0-1

hyuse202 avatar Dec 06 '23 16:12 hyuse202

@cs-mshah Encountered the same issue (M1 MacBook Air), but resolved now.

Fix is to install Docker Desktop instead of installing docker and docker-buildx separately through brew.

So brew uninstall docker, brew uninstall docker-buildx. Install Docker Desktop. Open after installation, run through setup. cog run python from docs/getting-started.md should now work.

e6quisitory avatar Dec 26 '23 01:12 e6quisitory