dnephin / dobi

A build automation tool for Docker applications
https://dnephin.github.io/dobi/
Apache License 2.0
309 stars 36 forks source link

Support for running with Windows Containers (API version 1.24) #185

Closed flcdrg closed 4 years ago

flcdrg commented 4 years ago

Running latest Docker for Windows Edge.

In Linux mode:

Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:23:10 2020
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

But when in Windows Containers mode

Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:23:10 2020
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.24)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:37:20 2020
  OS/Arch:          windows/amd64
  Experimental:     true

Note that the API version has a minimum of 1.24. When trying to run dobi in Windows containers mode, the following error is displayed:

[WARN] Failed to load auth config: No docker configuration found
[ERROR] failed to execute task "sql-server:build": API error (400): client version 1.23 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version
tduffield commented 4 years ago

Per https://github.com/dnephin/dobi/blob/master/cmd/dobi.go#L117, you should be able to overwrite this setting using DOCKER_API_VERSION. It's worked for me. However, I've included the bump in a PR I'm working on as well.

flcdrg commented 4 years ago

oh interesting! I'll give that a try and let you know how it went.