From 91eb6ee5ee97a5e1b6dd735cc1d71fa8c1c5a338 Mon Sep 17 00:00:00 2001 From: Austen Lacy Date: Mon, 25 Jul 2016 17:45:31 -0400 Subject: [PATCH] added mtu param --- DOCS.md | 1 + main.go | 6 ++++++ plugin.go | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/DOCS.md b/DOCS.md index ddaabe3..6d963ce 100644 --- a/DOCS.md +++ b/DOCS.md @@ -15,6 +15,7 @@ Use the Docker plugin to build and push Docker images to a registry. The followi * `storage_driver` - use `aufs`, `devicemapper`, `btrfs` or `overlay` driver * `storage_path` - location of docker daemon storage on disk * `build_args` - [build arguments](https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables-build-arg) to pass to `docker build` +* `mtu` - custom [mtu settings](https://docs.docker.com/v1.8/articles/networking/#docker0) when starting the docker daemon The following is a sample Docker configuration in your .drone.yml file: diff --git a/main.go b/main.go index 22ce220..80a7af6 100644 --- a/main.go +++ b/main.go @@ -58,6 +58,11 @@ func main() { Usage: "docker daemon bride ip address", EnvVar: "PLUGIN_BIP", }, + cli.StringFlag{ + Name: "daemon.mtu", + Usage: "docker daemon custom mtu setting", + EnvVar: "PLUGIN_MTU", + }, cli.StringSliceFlag{ Name: "daemon.dns", Usage: "docker daemon dns server", @@ -164,6 +169,7 @@ func run(c *cli.Context) { Debug: c.Bool("daemon.debug"), Bip: c.String("daemon.bip"), DNS: c.StringSlice("daemon.dns"), + MTU: c.String("daemon.mtu"), }, } diff --git a/plugin.go b/plugin.go index 73d6bac..b1fa585 100644 --- a/plugin.go +++ b/plugin.go @@ -21,6 +21,7 @@ type ( Debug bool // Docker daemon started in debug mode Bip string // Docker daemon network bridge IP address DNS []string // Docker daemon dns server + MTU string // Docker daemon mtu setting } // Login defines Docker login parameters. @@ -206,6 +207,9 @@ func commandDaemon(daemon Daemon) *exec.Cmd { for _, dns := range daemon.DNS { args = append(args, "--dns", dns) } + if len(daemon.MTU) != 0 { + args = append(args, "--mtu", daemon.MTU) + } return exec.Command(dockerExe, args...) }