1- LATEST_UBUNTU_VERSION = "jammy"
1+ LATEST_UBUNTU_VERSION = "noble"
2+ LATEST_RUBY_VERSION = "3.4"
23
34def download ( url )
45 require "net/http"
@@ -271,8 +272,17 @@ namespace :docker do
271272 [ '--amend' , manifest_name ]
272273 } . flatten
273274
275+ latest_tag = nil
274276 tags . each do |tag |
275277 sh 'docker' , 'manifest' , 'create' , "#{ tag } " , *amend_args
278+ if tag =~ /#{ LATEST_UBUNTU_VERSION } /
279+ non_ubuntu_tag = tag . sub ( /-#{ LATEST_UBUNTU_VERSION } / , '' )
280+ sh 'docker' , 'manifest' , 'create' , "#{ non_ubuntu_tag } " , *amend_args
281+ if image_version_suffix . empty? && ruby_version =~ /^#{ LATEST_RUBY_VERSION } / && latest_tag . nil?
282+ latest_tag = tag . sub ( /#{ ruby_version } -#{ LATEST_UBUNTU_VERSION } / , "latest" )
283+ sh 'docker' , 'manifest' , 'create' , "#{ latest_tag } " , *amend_args
284+ end
285+ end
276286 end
277287 end
278288
@@ -282,8 +292,17 @@ namespace :docker do
282292
283293 _ , tags = make_tags ( ruby_version , image_version_suffix )
284294
295+ latest_tag = nil
285296 tags . each do |tag |
286297 sh 'docker' , 'manifest' , 'push' , "#{ tag } "
298+ if tag =~ /#{ LATEST_UBUNTU_VERSION } /
299+ non_ubuntu_tag = tag . sub ( /-#{ LATEST_UBUNTU_VERSION } / , '' )
300+ sh 'docker' , 'manifest' , 'push' , "#{ non_ubuntu_tag } "
301+ if image_version_suffix . empty? && ruby_version =~ /^#{ LATEST_RUBY_VERSION } / && latest_tag . nil?
302+ latest_tag = tag . sub ( /#{ ruby_version } -#{ LATEST_UBUNTU_VERSION } / , "latest" )
303+ sh 'docker' , 'manifest' , 'push' , "#{ latest_tag } "
304+ end
305+ end
287306 end
288307 end
289308 end
0 commit comments