minke 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/docker/Dockerfile +9 -0
- data/lib/minke/docker/service_discovery.rb +3 -3
- data/lib/minke/rake/app.rake +1 -1
- data/lib/minke/tasks/task.rb +1 -1
- data/lib/minke/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MzMzMTRjZjYyYjg4NjViMzQzNWQ0NjNiMWRiMjhkNzlhMjQ5MTYxMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODFlM2Q5ZTNiYWU3NWQwMTJiNWM5NTgxOWI3YWVkNjVkZjE2YzcxMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWEzYmRlZjE1Y2Q4MWQ4NDNmYWUxYzZhY2I3MjM2NDVhNWE3ODE2ZjMzNzFh
|
10
|
+
NGJmNGRiMDcxY2FkOTg3MmYwNDhlOGZiMDE3MjU2MTgxOWU0NTEzNTdlMmFl
|
11
|
+
MzE5ODFkOTVjZjQ5MzNkZjA5ZWE2ZjU4N2NmOTY3Zjk4ZTU0OGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjcyYTY2NjJlMTY4ZDRjNTMwZmU2NTdlODdhZDgyYzkxOTViYzExYmU4MDY1
|
14
|
+
OWZjY2JhZjZlY2M5MDM5ZmM0YjVmMWQ2NWZiOWFmM2ZlMDFlNTFiNjNjYzBk
|
15
|
+
NDk1ZWVmZGRlYTY1MGQ1NmUzZTNiZWY3OGQyMjFjN2E3MTM0MDM=
|
data/docker/Dockerfile
CHANGED
@@ -1,4 +1,13 @@
|
|
1
1
|
FROM ruby:latest
|
2
2
|
|
3
|
+
ENV COMPOSE_VERSION 1.7.1
|
4
|
+
ENV MACHINE_VERSION 0.7.0
|
5
|
+
|
6
|
+
RUN apt-get update -q \
|
7
|
+
&& apt-get install -y -q --no-install-recommends curl ca-certificates \
|
8
|
+
&& curl -o /usr/local/bin/docker-compose -L \
|
9
|
+
"https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-x86_64" \
|
10
|
+
&& chmod +x /usr/local/bin/docker-compose
|
11
|
+
|
3
12
|
COPY ./Gemfile Gemfile
|
4
13
|
RUN bundle install
|
@@ -32,15 +32,15 @@ module Minke
|
|
32
32
|
# Will attempt to locate the private details for a running container given
|
33
33
|
# its name and private port
|
34
34
|
# Parameters:
|
35
|
+
# - network: the name of the network the container is running on
|
35
36
|
# - service_name: the name of the running service
|
36
37
|
# - private_port: the private port which you wish to retrieve an address for
|
37
38
|
# Returns:
|
38
39
|
# private address for the container e.g. 172.17.0.2:8080
|
39
|
-
def bridge_address_for service_name, private_port
|
40
|
+
def bridge_address_for network, service_name, private_port
|
40
41
|
begin
|
41
|
-
puts "/#{@project_name}_#{service_name}_1"
|
42
42
|
container_details = find_container_by_name "/#{@project_name}_#{service_name}_1"
|
43
|
-
ip = container_details.first.info['NetworkSettings']['Networks'][
|
43
|
+
ip = container_details.first.info['NetworkSettings']['Networks']["#{network}"]['IPAddress']
|
44
44
|
rescue
|
45
45
|
raise "Unable to find bridge address for '#{service_name}' on port #{private_port}"
|
46
46
|
end
|
data/lib/minke/rake/app.rake
CHANGED
@@ -72,7 +72,7 @@ namespace :app do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def create_dependencies
|
75
|
-
@project_name = "minke#{SecureRandom.urlsafe_base64(12)}".downcase
|
75
|
+
@project_name = "minke#{SecureRandom.urlsafe_base64(12)}".downcase.gsub('-', '')
|
76
76
|
@system_runner = Minke::Docker::SystemRunner.new
|
77
77
|
@docker_compose_factory ||= Minke::Docker::DockerComposeFactory.new @system_runner, @project_name
|
78
78
|
@docker_runner ||= Minke::Docker::DockerRunner.new
|
data/lib/minke/tasks/task.rb
CHANGED
@@ -88,7 +88,7 @@ module Minke
|
|
88
88
|
if url.type == 'external'
|
89
89
|
"#{url.protocol}://#{url.address}:#{url.port}#{url.path}"
|
90
90
|
elsif url.type == 'bridge'
|
91
|
-
address = @service_discovery.bridge_address_for url.address, url.port
|
91
|
+
address = @service_discovery.bridge_address_for ENV['DOCKER_NETWORK'], url.address, url.port
|
92
92
|
"#{url.protocol}://#{address}#{url.path}"
|
93
93
|
elsif url.type == 'public'
|
94
94
|
address = @service_discovery.public_address_for url.address, url.port
|
data/lib/minke/version.rb
CHANGED