All Projects → lxc → Ruby Lxc

lxc / Ruby Lxc

Licence: lgpl-2.1
ruby bindings for liblxc

Programming Languages

c
50402 projects - #5 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Ruby Lxc

Lxd
Powerful system container and virtual machine manager
Stars: ✭ 3,115 (+2608.7%)
Mutual labels:  containers, lxc
Lxdock
Build and orchestrate your development environments with LXD - a.k.a. Vagrant is Too Heavy™
Stars: ✭ 350 (+204.35%)
Mutual labels:  containers, lxc
Lxdmosaic
Web interface to manage multiple instance of lxd
Stars: ✭ 270 (+134.78%)
Mutual labels:  containers, lxc
Distrobuilder
System container image builder for LXC and LXD
Stars: ✭ 211 (+83.48%)
Mutual labels:  containers, lxc
Lxc Ci
LXC continuous integration and build scripts
Stars: ✭ 110 (-4.35%)
Mutual labels:  containers, lxc
Lxc
LXC - Linux Containers
Stars: ✭ 3,583 (+3015.65%)
Mutual labels:  containers, lxc
Go Lxc
Go bindings for liblxc
Stars: ✭ 336 (+192.17%)
Mutual labels:  containers, lxc
Vas Quod
🚡 Minimal linux container runtime.
Stars: ✭ 404 (+251.3%)
Mutual labels:  containers, lxc
Lxcfs
FUSE filesystem for LXC
Stars: ✭ 602 (+423.48%)
Mutual labels:  containers, lxc
Lxdui
LXDUI is a web UI for the native Linux container technology LXD/LXC
Stars: ✭ 443 (+285.22%)
Mutual labels:  containers, lxc
Lxc Pkg Ubuntu
LXC Ubuntu packaging
Stars: ✭ 11 (-90.43%)
Mutual labels:  containers, lxc
Amicontained
Container introspection tool. Find out what container runtime is being used as well as features available.
Stars: ✭ 638 (+454.78%)
Mutual labels:  containers, lxc
Addon Lxdone
Allows OpenNebula to manage Linux Containers via LXD
Stars: ✭ 36 (-68.7%)
Mutual labels:  containers, lxc
Pipeline
Banzai Cloud Pipeline is a solution-oriented application platform which allows enterprises to develop, deploy and securely scale container-based applications in multi- and hybrid-cloud environments.
Stars: ✭ 1,445 (+1156.52%)
Mutual labels:  containers
Labs
This is a collection of tutorials for learning how to use Docker with various tools. Contributions welcome.
Stars: ✭ 10,443 (+8980.87%)
Mutual labels:  containers
Karn
Simplifying Seccomp enforcement in containerized or non-containerized apps
Stars: ✭ 104 (-9.57%)
Mutual labels:  containers
Mist Ce
Mist is an open source, multi-cloud management platform
Stars: ✭ 1,391 (+1109.57%)
Mutual labels:  containers
Containers
Containers backed by std.experimental.allocator
Stars: ✭ 111 (-3.48%)
Mutual labels:  containers
Cas Webapp Docker
Apereo CAS Server web application running inside a docker container.
Stars: ✭ 107 (-6.96%)
Mutual labels:  containers
Criu
Checkpoint/Restore tool
Stars: ✭ 1,389 (+1107.83%)
Mutual labels:  containers

Ruby-LXC

Build Status

Introduction

Ruby-LXC is a Ruby binding for liblxc. It allows the creation and management of Linux Containers from Ruby scripts.

Build and installation

Assuming a current installation of LXC is available, to install Ruby-LXC simply run the commands below

sudo apt-get install ruby-dev lxc-dev

bundle install
bundle exec rake compile
bundle exec rake gem
gem install pkg/ruby-lxc-1.2.0.gem

or just add this to your Gemfile

gem "ruby-lxc", github: "lxc/ruby-lxc", require: "lxc"

Usage

  • Container lifecycle management (create, start, stop and destroy containers)
require 'lxc'
c = LXC::Container.new('foo')
c.create('ubuntu') # create a container named foo with ubuntu template
c.start
# attach to a running container
c.attach do
  LXC.run_command('ifconfig eth0')
end
c.stop
c.destroy
  • Container inspection
c.name
c.config_path
c.config_item('lxc.cap.drop')
c.cgroup_item('memory.limit_in_bytes')
c.init_pid
c.interfaces
c.ip_addresses
c.state
  • Additional state changing operations (freezing, unfreezing and cloning containers)
c.freeze
c.unfreeze
c.reboot
c.shutdown
  • Clone a container
# clone foo into bar. Parent container has to be frozen or stopped.
clone = c.clone('bar')
  • Wait for a state change
# wait until container goes to STOPPED state, else timeout after 10 seconds
c.wait(:stopped, 10)

Check the provided rdoc documentation for a full list of methods. You can generate it running

rake rdoc
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].