From f1b9df91722a229fd0cefd7a0868933b6b811544 Mon Sep 17 00:00:00 2001
From: Sebastiaan van Stijn <github@gone.nl>
Date: Fri, 18 Nov 2016 22:04:27 +0100
Subject: [PATCH] swap position of "host" and "ip"

the service definition uses the format as defined
in  http://man7.org/linux/man-pages/man5/hosts.5.html
(IP_address canonical_hostname [aliases...])

This format is the _reverse_ of the format used in
the container API.

Commit f32869d956eb175f88fd0b16992d2377d8eae79c
inadvertently used the incorrect order.

This fixes the order, and correctly sets it to;

    IP-Address hostname

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
---
 cli/command/stack/deploy.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cli/command/stack/deploy.go b/cli/command/stack/deploy.go
index 63adeacd62..3075477b83 100644
--- a/cli/command/stack/deploy.go
+++ b/cli/command/stack/deploy.go
@@ -531,7 +531,7 @@ func convertService(
 func convertExtraHosts(extraHosts map[string]string) []string {
 	hosts := []string{}
 	for host, ip := range extraHosts {
-		hosts = append(hosts, fmt.Sprintf("%s %s", host, ip))
+		hosts = append(hosts, fmt.Sprintf("%s %s", ip, host))
 	}
 	return hosts
 }