docker-compose 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/docker/compose/mapper.rb +11 -11
- data/lib/docker/compose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5307fb75ebdc1b6f79b326c6d31ff1ba3e08e1d
|
4
|
+
data.tar.gz: 5df6cd398d2238151ad063545ba94a5f3a4d32f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a17412a0364656f01e2ff5efe203d5a961f156ad09c699155e11255560d6c0fd2d600c5cbbb08fb5fdde688e71939940dbefcee0aaad472af7a99a7331da8e6
|
7
|
+
data.tar.gz: d7a046c4c39b75fe2fb5a3b69264324debc58571f5a72d090b54896c03ca40ce80017c27b15eb636bc3dae6f3f71f79c176ba201b4084c5651202e3a3304f589
|
@@ -20,7 +20,7 @@ module Docker::Compose
|
|
20
20
|
# @param [NetInfo] net_info
|
21
21
|
# @yield yields with each substituted (key, value) pair
|
22
22
|
def self.map(env, strict:true, session:Session.new, net_info:NetInfo.new)
|
23
|
-
mapper = self.new(session, net_info.
|
23
|
+
mapper = self.new(session, net_info.docker_routable_ip, strict:strict)
|
24
24
|
env.each_pair do |k, v|
|
25
25
|
begin
|
26
26
|
v = mapper.map(v)
|
@@ -33,15 +33,15 @@ module Docker::Compose
|
|
33
33
|
|
34
34
|
# Create an instance of Mapper
|
35
35
|
# @param [Docker::Compose::Session] session
|
36
|
-
# @param [String]
|
37
|
-
# Docker services (i.e. the `DOCKER_HOST` hostname or
|
38
|
-
# a non-clustered Docker environment)
|
36
|
+
# @param [String] docker_host DNS hostnrame or IPv4 address of the host
|
37
|
+
# that is publishing Docker services (i.e. the `DOCKER_HOST` hostname or
|
38
|
+
# IP if you are using a non-clustered Docker environment)
|
39
39
|
# @param [Boolean] strict if true, raise BadSubstitution when unrecognized
|
40
|
-
# syntax is passed to #map; if false, simply return
|
41
|
-
# substituting anything
|
42
|
-
def initialize(session,
|
40
|
+
# syntax is passed to #map; if false, simply return unrecognized
|
41
|
+
# values without substituting anything
|
42
|
+
def initialize(session, docker_host, strict:true)
|
43
43
|
@session = session
|
44
|
-
@
|
44
|
+
@docker_host = docker_host
|
45
45
|
@strict = strict
|
46
46
|
end
|
47
47
|
|
@@ -70,7 +70,7 @@ module Docker::Compose
|
|
70
70
|
if uri && uri.scheme && uri.host
|
71
71
|
# absolute URI with scheme, authority, etc
|
72
72
|
uri.port = published_port(uri.host, uri.port)
|
73
|
-
uri.host = @
|
73
|
+
uri.host = @docker_host
|
74
74
|
return uri.to_s
|
75
75
|
elsif pair.size == 2
|
76
76
|
# "host:port" pair; three sub-cases...
|
@@ -85,11 +85,11 @@ module Docker::Compose
|
|
85
85
|
service = pair.first
|
86
86
|
port = pair.last.gsub(REMOVE_ELIDED, '')
|
87
87
|
published_port(service, port)
|
88
|
-
return @
|
88
|
+
return @docker_host
|
89
89
|
else
|
90
90
|
# output port:hostname pair
|
91
91
|
port = published_port(pair.first, pair.last)
|
92
|
-
return "#{@
|
92
|
+
return "#{@docker_host}:#{port}"
|
93
93
|
end
|
94
94
|
elsif @strict
|
95
95
|
raise BadSubstitution, "Can't understand '#{value}'"
|