Created
August 22, 2013 03:30
-
-
Save ucarion/6302908 to your computer and use it in GitHub Desktop.
Call Docker image through bash
This file contains 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
require 'docker' | |
require 'shellwords' | |
image = Docker::Image.all.first | |
s = IO.read('tmp.rb').shellescape | |
cmd = [ "/bin/bash", "-c", "echo #{s} > roobee.rb; ruby roobee.rb" ] | |
puts "Response from Docker: " | |
puts image.run(cmd).attach |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment