Skip to content

Commit

Permalink
pass platform option to docker when pulling base image (#33)
Browse files Browse the repository at this point in the history
Recent changes to docker broke auto pulling the
base image and this change fixes the problem.
  • Loading branch information
skaes authored Dec 12, 2024
1 parent 6ef946a commit 835024f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/fpm/fry/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/fry/command/cook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 835024f

Please sign in to comment.