[PLDWWW] page added: packages:lxc-docker
"Elan Ruusamäe (glen)"
glen at pld-linux.org
Mon Aug 26 22:58:26 CEST 2013
created
--- ---
+++ https://www.pld-linux.org/packages/lxc-docker
====== LXC Docker ======
[[https://www.docker.io/|Docker, The Linux container engine]] is an open source project to pack, ship and run any application as a lightweight container.
===== Vagrant playground =====
To play around inside [[vagrant]], create ''Vagrantfile'' and run ''vagrant up'' followed by ''vagrant ssh''.
<code ruby Vagrantfile>
# -*- mode: ruby -*-
# vi: set ft=ruby :
BOX_NAME = ENV['BOX_NAME'] || "pld64"
BOX_URI = ENV['BOX_URI'] || "ftp://ftp.pld-linux.org/people/glen/vm/pld64.box"
hostname = File.basename(File.dirname(__FILE__))
print "\033k#{hostname}\033\\"
Vagrant::Config.run do |config|
# Setup virtual machine box. This VM configuration code is always executed.
config.vm.box = BOX_NAME
config.vm.box_url = BOX_URI
# Provision docker and new kernel if deployment was not done
if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
pkg_cmd = "set -xe; "
# install libcgroup and enable mounts
pkg_cmd << "poldek -u --noask libcgroup lxc iptables; "
pkg_cmd << "sed -i -e '/^#mount/,$ s/^#//' /etc/cgconfig.conf; "
pkg_cmd << "echo 'docker -d &' >> /etc/rc.d/rc.local; "
# Add lxc-docker package
# https://bugs.launchpad.net/poldek/+bug/1216250
pkg_cmd << "poldek -u --noask lxc-docker --sn th-ready --nodeps; "
# Add 3.10 kernel from th-ready
pkg_cmd << "poldek -u --noask kernel --sn th-ready; "
# Add guest additions if local vbox VM
is_vbox = true
ARGV.each do |arg| is_vbox &&= !arg.downcase.start_with?("--provider") end
if is_vbox
pkg_cmd << "poldek -u --noask kernel-misc-vboxguest kernel-misc-vboxsf --sn th-ready; "
end
# Activate new kernel
pkg_cmd << "shutdown -r +1; "
config.vm.provision :shell, :inline => pkg_cmd
end
end
# Providers were added on Vagrant >= 1.1.0
Vagrant::VERSION >= "1.1.0" and Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
config.vm.box = BOX_NAME
config.vm.box_url = BOX_URI
end
end
</code>
And there, you can get familiar with [[https://www.docker.io/gettingstarted/|getting started]] samples.
There's also [[https://index.docker.io/u/glen/pld/|pld test]] image prepared:
<code bash>
vagrant at pld64 ~$ sudo docker run -i -t glen/pld bash
root at ae0aac5de155 ~#
</code>
But you probably want to create your own with ''docker import'', see available samples in [[https://github.com/dotcloud/docker/tree/master/contrib|docker/contrib/]].
Diff URL:
---
--
This mail was generated by DokuWiki at
https://www.pld-linux.org/
More information about the pld-cvs-commit
mailing list