0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-22 10:10:39 +00:00

feat: add daemon option max-concurrent-uploads (#18)

This commit is contained in:
Robert Kaussow 2023-09-03 22:33:59 +02:00 committed by GitHub
parent ecf9348149
commit 787934288e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 19 deletions

View File

@ -90,6 +90,14 @@ properties:
defaultValue: false defaultValue: false
required: false required: false
- name: max_concurrent_uploads
description: |
By default the Docker daemon will push five layers of an image at a time. If you are on a low bandwidth connection this may cause
timeout issues and you may want to lower with this option.
type: string
defaultValue: 5
required: false
- name: containerfile - name: containerfile
description: Set the containerfile to use for the image build. description: Set the containerfile to use for the image build.
defaultValue: Containerfile defaultValue: Containerfile

View File

@ -115,11 +115,18 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
Destination: &settings.Daemon.BuildkitConfig, Destination: &settings.Daemon.BuildkitConfig,
Category: category, Category: category,
}, },
&cli.StringFlag{
Name: "daemon.max-concurrent-uploads",
EnvVars: []string{"PLUGIN_MAX_CONCURRENT_UPLOADS"},
Usage: "max concurrent uploads for each push",
Destination: &settings.Daemon.MaxConcurrentUploads,
Category: category,
},
&cli.StringFlag{ &cli.StringFlag{
Name: "containerfile", Name: "containerfile",
EnvVars: []string{"PLUGIN_CONTAINERFILE"}, EnvVars: []string{"PLUGIN_CONTAINERFILE"},
Usage: "containerfile to use for the image build", Usage: "max concurrent uploads",
Value: "Containerfile", Value: "5",
Destination: &settings.Build.Containerfile, Destination: &settings.Build.Containerfile,
Category: category, Category: category,
}, },

View File

@ -214,6 +214,7 @@ func hasProxyBuildArg(build *Build, key string) bool {
func commandDaemon(daemon Daemon) *execabs.Cmd { func commandDaemon(daemon Daemon) *execabs.Cmd {
args := []string{ args := []string{
"--data-root", daemon.StoragePath, "--data-root", daemon.StoragePath,
"--max-concurrent-uploads", daemon.MaxConcurrentUploads,
"--host=unix:///var/run/docker.sock", "--host=unix:///var/run/docker.sock",
} }
@ -229,11 +230,11 @@ func commandDaemon(daemon Daemon) *execabs.Cmd {
args = append(args, "--ipv6") args = append(args, "--ipv6")
} }
if len(daemon.Mirror) != 0 { if daemon.Mirror != "" {
args = append(args, "--registry-mirror", daemon.Mirror) args = append(args, "--registry-mirror", daemon.Mirror)
} }
if len(daemon.Bip) != 0 { if daemon.Bip != "" {
args = append(args, "--bip", daemon.Bip) args = append(args, "--bip", daemon.Bip)
} }
@ -245,7 +246,7 @@ func commandDaemon(daemon Daemon) *execabs.Cmd {
args = append(args, "--dns-search", dnsSearch) args = append(args, "--dns-search", dnsSearch)
} }
if len(daemon.MTU) != 0 { if daemon.MTU != "" {
args = append(args, "--mtu", daemon.MTU) args = append(args, "--mtu", daemon.MTU)
} }

View File

@ -35,6 +35,7 @@ type Daemon struct {
IPv6 bool // Docker daemon IPv6 networking IPv6 bool // Docker daemon IPv6 networking
Experimental bool // Docker daemon enable experimental mode Experimental bool // Docker daemon enable experimental mode
BuildkitConfig string // Docker buildkit config BuildkitConfig string // Docker buildkit config
MaxConcurrentUploads string
} }
// Login defines Docker login parameters. // Login defines Docker login parameters.