Last active
December 25, 2015 07:19
-
-
Save apatil/6938813 to your computer and use it in GitHub Desktop.
On Ubuntu 12.04, with Docker version 0.6.3, build b0a49a3, this script will cause iptables failures to prevent launch of some docker containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var shell = require("shelljs") | |
var n = 100; | |
var nPorts = 10; | |
var port = 40000; | |
var launchCmds = []; | |
for (var i = 0; i < n; i++) { | |
var portString = ""; | |
var innerPort = 3000; | |
for (var j=0; j<nPorts; j++) { | |
portString += " -p " + port + ":" + innerPort; | |
innerPort++; | |
port++; | |
} | |
launchCmds.push("docker -H 127.0.0.1:4243 run -d" + portString + " ubuntu:12.04 sleep 5") | |
} | |
var ids = []; | |
var cb = function(code, output) { | |
console.log(code, output); | |
}; | |
for (var i = 0; i < n; i++) { | |
shell.exec(launchCmds[i], {async: true}, cb) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment