From cf1a2807217e2876dbb029b05cb2c37df1d07555 Mon Sep 17 00:00:00 2001 From: Andrew Kennedy Date: Fri, 18 Sep 2015 20:25:04 +0100 Subject: [PATCH] Fix open port issue when starting container --- .../brooklyn/entity/container/docker/DockerContainerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java b/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java index 6e0576f3..15b6c1dd 100644 --- a/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java +++ b/docker/src/main/java/brooklyn/entity/container/docker/DockerContainerImpl.java @@ -522,7 +522,7 @@ public DockerContainerLocation createLocation(Map flags) { .put(LocationConfigKeys.PRIVATE_KEY_DATA, null) .put(LocationConfigKeys.PRIVATE_KEY_FILE, null) .put(CloudLocationConfig.WAIT_FOR_SSHABLE, false) - .put(JcloudsLocationConfig.INBOUND_PORTS, getOpenPorts(entity)) + .put(JcloudsLocationConfig.INBOUND_PORTS, options.getInboundPorts()) .put(JcloudsLocation.USE_PORT_FORWARDING, true) .put(JcloudsLocation.PORT_FORWARDER, subnetTier.getPortForwarderExtension()) .put(JcloudsLocation.PORT_FORWARDING_MANAGER, subnetTier.getPortForwardManager()) @@ -615,7 +615,7 @@ public void deleteLocation() { /** Returns the set of configured ports an entity is listening on. */ protected Set getOpenPorts(Entity entity) { - Set ports = MutableSet.of(); + Set ports = MutableSet.of(22); for (ConfigKey k: entity.getEntityType().getConfigKeys()) { if (PortRange.class.isAssignableFrom(k.getType())) { PortRange p = (PortRange) entity.config().get(k);