Bug 550348 - Java container support shows image id rather than repo tag

- fix ContainerLauncher.launch() method to check if the image name to be
  shown matches the image id and if so, get the DockerImage to figure
  out the first repo tag and use it instead

Change-Id: Ifc35e9efffc6aaab64bd3c077212550a604d9017
Reviewed-on: https://git.eclipse.org/r/148164
Tested-by: Linux Tools Bot <linuxtools-bot@eclipse.org>
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
diff --git a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
index 66275d9..8d13f96 100644
--- a/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
+++ b/containers/org.eclipse.linuxtools.docker.ui/src/org/eclipse/linuxtools/docker/ui/launch/ContainerLauncher.java
@@ -956,11 +956,12 @@
 
 		IDockerImageInfo imageInfo = connection.getImageInfo(image);
 		if (imageInfo == null) {
+			final String name = image;
 			Display.getDefault()
 					.syncExec(() -> MessageDialog.openError(
 							PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
 							DVMessages.getString(ERROR_LAUNCHING_CONTAINER),
-							Messages.getFormattedString("ContainerLaunch.imageNotFound.error", image)));
+							Messages.getFormattedString("ContainerLaunch.imageNotFound.error", name)));
 			return;
 		}
 
@@ -1025,6 +1026,11 @@
 
 		final IDockerHostConfig hostConfig = hostBuilder.build();
 
+		if (image.equals(imageInfo.id())) {
+			IDockerImage dockerImage = ((DockerConnection) connection).getImage(image);
+			image = dockerImage.repoTags().get(0);
+		}
+
 		final String imageName = image;
 		final boolean keepContainer = keep;
 		final String consoleId = id;