Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iptables option to the docker daemon to make the plugin(DinD) could run parallel #371

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/drone-docker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ func main() {
Usage: "docker daemon executes in debug mode",
EnvVar: "PLUGIN_DEBUG,DOCKER_LAUNCH_DEBUG",
},
cli.BoolFlag{
Name: "daemon.iptables",
Usage: "docker daemon disable addition of iptables rules if set to true. Default false",
EnvVar: "PLUGIN_IPTABLES_OFF",
},
cli.BoolFlag{
Name: "daemon.off",
Usage: "don't start the docker daemon",
Expand Down Expand Up @@ -327,6 +332,7 @@ func run(c *cli.Context) error {
Insecure: c.Bool("daemon.insecure"),
Disabled: c.Bool("daemon.off"),
IPv6: c.Bool("daemon.ipv6"),
IPTablesOff: c.Bool("daemon.iptables"),
Debug: c.Bool("daemon.debug"),
Bip: c.String("daemon.bip"),
DNS: c.StringSlice("daemon.dns"),
Expand Down
4 changes: 4 additions & 0 deletions docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type (
Debug bool // Docker daemon started in debug mode
Bip string // Docker daemon network bridge IP address
DNS []string // Docker daemon dns server
IPTablesOff bool // docker daemon enable/disable addition of iptables rules
DNSSearch []string // Docker daemon dns search domain
MTU string // Docker daemon mtu setting
IPv6 bool // Docker daemon IPv6 networking
Expand Down Expand Up @@ -486,6 +487,9 @@ func commandDaemon(daemon Daemon) *exec.Cmd {
if daemon.Experimental {
args = append(args, "--experimental")
}
if daemon.IPTablesOff {
args = append(args, "--iptables=false")
}
return exec.Command(dockerdExe, args...)
}

Expand Down