diff --git a/lib/fpm/fry/client.rb b/lib/fpm/fry/client.rb index 88c34ca..faa5dc2 100644 --- a/lib/fpm/fry/client.rb +++ b/lib/fpm/fry/client.rb @@ -190,7 +190,7 @@ def changes(name) raise end - def pull(image) + def pull(image, platform: nil) last_status = "" streamer = lambda do |chunk, remaining_bytes, total_bytes| chunk.each_line do |line| @@ -208,7 +208,9 @@ def pull(image) end end end - agent.post(path: url('images','create'), query: {'fromImage' => image}, :response_block => streamer) + query = {'fromImage' => image} + query['platform'] = platform if platform + agent.post(path: url('images','create'), query: query, :response_block => streamer) end def delete(image) diff --git a/lib/fpm/fry/command/cook.rb b/lib/fpm/fry/command/cook.rb index 0a3b45e..13bc755 100644 --- a/lib/fpm/fry/command/cook.rb +++ b/lib/fpm/fry/command/cook.rb @@ -209,7 +209,7 @@ def update? end def pull_base_image! - client.pull(image) + client.pull(image, platform: platform) rescue Excon::Error logger.error "could not pull base image #{image}" raise