Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass platform option to docker when pulling base image #33

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading