Added option mapping to set the user and group for the container.

This commit is contained in:
Fabian Schlenz 2020-09-04 06:15:05 +02:00
parent 1ee6de03c1
commit 73c3f5aacb

1
dup.rb
View File

@ -23,6 +23,7 @@ MAPPINGS = [
['devices', '--device'], ['devices', '--device'],
['net', '--net'], ['net', '--net'],
['ipv6', '--ipv6'], ['ipv6', '--ipv6'],
['user', '--user'],
['networks', '--network', lambda{|c,i| c.NetworkSettings.Networks.to_h.keys.map(&:to_s)}, {:type=>:hidden}], ['networks', '--network', lambda{|c,i| c.NetworkSettings.Networks.to_h.keys.map(&:to_s)}, {:type=>:hidden}],
['entrypoint', '--entrypoint', lambda{|c,i| (ep=c.Config.Entrypoint) == i.Config.Entrypoint ? nil : ep}, {:allow_empty=>true}], ['entrypoint', '--entrypoint', lambda{|c,i| (ep=c.Config.Entrypoint) == i.Config.Entrypoint ? nil : ep}, {:allow_empty=>true}],
['labels', '--label', lambda{|c,i| l=Hash[c.Config.Labels.to_h.delete_if{|k,v| i.Config.Labels[k]==v rescue false}.map{|k,v| [k.to_s, v]}] ; l}], ['labels', '--label', lambda{|c,i| l=Hash[c.Config.Labels.to_h.delete_if{|k,v| i.Config.Labels[k]==v rescue false}.map{|k,v| [k.to_s, v]}] ; l}],