Skip to content

Commit

Permalink
add iptables option to the docker daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
doyard committed Sep 7, 2022
1 parent a842dfe commit 8cf2863
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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 @@ -321,6 +326,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 @@ -482,6 +483,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

0 comments on commit 8cf2863

Please sign in to comment.