lib/minke/tasks/task.rb in minke-1.0.2 vs lib/minke/tasks/task.rb in minke-1.0.4
- old
+ new
@@ -68,10 +68,12 @@
begin
settings = @generator_settings.build_settings.docker_settings
if @build_file != nil
@build_image = "#{@config.application_name}-buildimage"
@docker_runner.build_image @build_file, @build_image
+ else
+ @docker_runner.pull_image @build_image unless @docker_runner.find_image @build_image
end
container, success = @docker_runner.create_and_run_container @build_image, settings.binds, settings.env, settings.working_directory, command
# throw exception if failed
@@ -83,10 +85,17 @@
def build_address url
if url.type == 'public'
"#{url.protocol}://#{url.address}:#{url.port}#{url.path}"
else
+ # if running on docker for mac we need to replace the ip address with the docker hosts
public_address = @compose.public_address url.address, url.port
+
+ ip = @docker_runner.get_docker_ip_address
+ if ip != "127.0.0.1" && ip != "0.0.0.0" && ip != nil
+ public_address.gsub!('0.0.0.0', ip)
+ end
+
"#{url.protocol}://#{public_address}#{url.path}"
end
end
def log message, level