Created
August 29, 2016 09:23
-
-
Save ryotarai/ebbb22f3ed783479381c6d6ceab57d61 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'json' | |
require 'shellwords' | |
cid = ARGV[0] | |
JSON.parse(`docker inspect #{cid}`).each do |c| | |
config = c['Config'] | |
args = %w!docker run -it! | |
config['Env'].each do |e| | |
args << '-e' << e | |
end | |
args << c['Image'] | |
args += config['Cmd'] | |
puts args.shelljoin | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment