File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ unless Concurrent.on_jruby? || Concurrent.on_truffleruby?
28
28
end
29
29
end
30
30
31
+ def which? ( executable )
32
+ !`which #{ executable } 2>/dev/null` . empty?
33
+ end
34
+
31
35
require 'rake_compiler_dock'
32
36
namespace :repackage do
33
37
desc '* with Windows fat distributions'
@@ -42,12 +46,19 @@ namespace :repackage do
42
46
Rake ::Task [ 'lib/concurrent-ruby/concurrent/concurrent_ruby.jar' ] . invoke
43
47
44
48
# build all gem files
49
+ rack_compiler_dock_kwargs = { }
50
+ if which? ( 'podman' ) and ( !which? ( 'docker' ) || `docker --version` . include? ( 'podman' ) )
51
+ # podman and only podman available, so RakeCompilerDock will use podman, otherwise it uses docker
52
+ rack_compiler_dock_kwargs = {
53
+ options : [ '--privileged' ] , # otherwise the directory in the image is empty
54
+ runas : false
55
+ }
56
+ end
45
57
%w[ x86-mingw32 x64-mingw32 ] . each do |plat |
46
58
RakeCompilerDock . sh (
47
59
"bundle install --local && bundle exec rake native:#{ plat } gem --trace" ,
48
60
platform : plat ,
49
- options : [ '--privileged' ] , # otherwise the directory in the image is empty
50
- runas : false )
61
+ **rack_compiler_dock_kwargs )
51
62
end
52
63
end
53
64
end
You can’t perform that action at this time.
0 commit comments