We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9a321a commit d2cefd1Copy full SHA for d2cefd1
lib/docker.js
@@ -144,7 +144,12 @@ function isMatchingImageName(targetName, imageName) {
144
145
function containerPort(dolphin, containerId) {
146
return dolphin.containers.inspect(containerId).then(function (container) {
147
- var port = Object.keys(container.NetworkSettings.Ports)[0].split('/')[0];
+ var portPriority = ['8080', '80']; // 80, then 8080, then others
148
+ var port = Object.keys(container.NetworkSettings.Ports)
149
+ .map(function (x) { return x.split('/')[0]})
150
+ .sort(function(port_a, port_b) {
151
+ return portPriority.indexOf(port_b) - portPriority.indexOf(port_a)
152
+ })[0];
153
154
var netNames = Object.keys(container.NetworkSettings.Networks);
155
if (netNames.length === 1) {
0 commit comments