Skip to content

Instantly share code, notes, and snippets.

@ranjib
Created January 17, 2014 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranjib/8469300 to your computer and use it in GitHub Desktop.
Save ranjib/8469300 to your computer and use it in GitHub Desktop.
c = LXC::Container.new('foo')
c.create('ubuntu')
c.start
# we'll start tripping from here
reader, writer = IO.pipe
c.attach(wait: true) do
reader.close # its a process clone, so you have all the variable
x = Dir['/*']
writer.write(Marshal.dump(x))
end
writer.close
x = Marshal.load(reader.read)
reader.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment