mirror of
https://github.com/thegeeklab/drone-docker-buildx.git
synced 2024-06-15 23:00:51 +02:00
add binfmt switch
This commit is contained in:
parent
52b4cc2805
commit
9ba08fde5b
|
@ -99,6 +99,12 @@ func settingsFlags(settings *plugin.Settings) []cli.Flag {
|
|||
EnvVars: []string{"PLUGIN_BUILDKIT_CONFIG"},
|
||||
Destination: &settings.Daemon.BuildkitConfig,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "daemon.install-binfmt",
|
||||
Usage: "run bimfmt binaries installer",
|
||||
EnvVars: []string{"PLUGIN_INSTALL_BINFMT"},
|
||||
Destination: &settings.Daemon.InstallBinfmt,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "dockerfile",
|
||||
Usage: "build dockerfile",
|
||||
|
|
|
@ -52,6 +52,14 @@ func commandInfo() *exec.Cmd {
|
|||
return exec.Command(dockerExe, "info")
|
||||
}
|
||||
|
||||
func commandInstallBinfmt() *exec.Cmd {
|
||||
return exec.Command(
|
||||
dockerExe, "run",
|
||||
"--privileged", "--rm",
|
||||
"tonistiigi/binfmt", "--install all"
|
||||
)
|
||||
}
|
||||
|
||||
func commandBuilder(daemon Daemon) *exec.Cmd {
|
||||
args := []string{
|
||||
"buildx",
|
||||
|
|
|
@ -27,6 +27,7 @@ type Daemon struct {
|
|||
IPv6 bool // Docker daemon IPv6 networking
|
||||
Experimental bool // Docker daemon enable experimental mode
|
||||
BuildkitConfig string // Docker buildkit config
|
||||
InstallBinfmt bool // Install binfmt binaries for better emulation support
|
||||
}
|
||||
|
||||
// Login defines Docker login parameters.
|
||||
|
@ -160,6 +161,11 @@ func (p *Plugin) Execute() error {
|
|||
p.settings.Build.Squash = false
|
||||
}
|
||||
|
||||
// run the binfmt docker image if requested
|
||||
if p.settings.Daemon.InstallBinfmt {
|
||||
commandInstallBinfmt()
|
||||
}
|
||||
|
||||
// add proxy build args
|
||||
addProxyBuildArgs(&p.settings.Build)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user