use container image platform only on docker 1.41+ (#591)

Commit af5140f13e introduced support for
specifying a container image platform for cross-platform image building.

Unfortunately, attempting to execute a docker command that includes the
`--platform` flag against Docker daemons using API Version 1.40 and
before results in the following error:

```
"specify container image platform" requires API version 1.41, but the Docker daemon API version is 1.40
```

To allow `act` to be used on the 19.03 Docker CE and earlier versions,
this patch simply checks the Docker daemon API version and only
specifies platform specification when the daemon API version is 1.41 or
greater.

Fixes Issue #586
This commit is contained in:
Jay Pipes
2021-03-30 13:10:42 -04:00
committed by GitHub
parent 737dfaff3d
commit d67e282f68
5 changed files with 36 additions and 10 deletions

1
go.mod
View File

@@ -4,6 +4,7 @@ go 1.14
require (
github.com/AlecAivazis/survey/v2 v2.2.7
github.com/Masterminds/semver v1.5.0
github.com/MichaelTJones/walk v0.0.0-20161122175330-4748e29d5718 // indirect
github.com/andreaskoch/go-fswatch v1.0.0
github.com/containerd/containerd v1.4.1 // indirect