Академический Документы
Профессиональный Документы
Культура Документы
About me
Free/Opensource software lover Senior Cloud Engineer @Acquia Drupal.org infrastructure/devops Drupalist & Linux enthusiast Father, artist, community facilitator
@ricardoamaro
About us
Vicente e Dlia
todays agenda
1. The sad VirtualMachine story 2. Containers and non-containers 3. Drupal on LXC 4. How to Puppetize a container 5. Docker & LXC 6. Shipping containers with Drupal
What is virtualization?
Hardware virtualization or platform virtualization refers to the creation of a virtual machine that acts like a real computer with an operating system.
Software executed on these virtual machines is separated from the underlying hardware resources.
Cloud infrastructure providers like Amazon Web Service sell virtual machines. EC2 revenue is expected to surpass $1B in revenue this year. That's a lot of VMs
Source : http://www.linuxjournal.com/content/containers%E2%80%94not-virtual-machines%E2%80%94are-future-cloud
Source : http://www.linuxjournal.com/content/containers%E2%80%94not-virtual-machines%E2%80%94are-future-cloud
Source : http://www.linuxjournal.com/content/containers%E2%80%94not-virtual-machines%E2%80%94are-future-cloud
source: http://openvz.org
but that had no resource and security isolation goals for multi-tenant designs...
~$ ls /sys/fs/cgroup blkio cpu cpuacct cpuset devices freezer hugetlb memory perf_event example: lxc-cgroup -n foo cpuset.cpus "0,3"
https://www.kernel.org/doc/Documentation/cgroups/cgroups.txt
LXC on Ubuntu
ricardo@ricardo-box:~$ sudo lxc-checkconfig Kernel configuration not found at /proc/config.gz; searching... Kernel configuration found at /boot/config-3.8.0-26-generic --- Namespaces --Namespaces: enabled Utsname namespace: enabled Ipc namespace: enabled Pid namespace: enabled User namespace: missing Network namespace: enabled Multiple /dev/pts instances: enabled --- Control groups --Cgroup: enabled Cgroup clone_children flag: enabled Cgroup device: enabled Cgroup sched: enabled Cgroup cpu account: enabled Cgroup memory controller: enabled Cgroup cpuset: enabled --- Misc --Veth pair device: enabled Macvlan: enabled Vlan: enabled File capabilities: enabled Note : Before booting a new kernel, you can check its configuration usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig
On Ubuntu 13.04
- We are able to exploit user namespaces and support stacked apparmor profiles - Apport hooks for better debug support, - Greater scriptability by providing a liblxc api.
By 14.04
User namespace should support container use by unprivileged users.
Other resources: http://www.ibm.com/developerworks/linux/library/l-lxc-security/index.html https://wiki.ubuntu.com/LxcSecurity http://wiki.ubuntu.com/UserNamespace
https://github.com/ricardoamaro/drupal-lxc-vagrant-docker
# redirect port 80 to the host sudo redir --lport=80 --cport=80 --caddr={container ip} & # and/or edit the /etc/hosts file with: ${IP} drupal phpmyadmin xhprof
Now I have to
use Docker
Docker Who??
this Docker
the Api
http://docs.docker.io/en/latest/api/registry_index_spec/
history Show the history of an image images import info List images Create a new filesystem image from the contents of a tarball Display system-wide information
the Registry
http://docs.docker.io/en/latest/api/index_api/
inspect Return low-level information on a container kill login logs port ps pull push Kill a running container Register or Login to the docker registry server Fetch the logs of a container Lookup the public-facing port which is NAT-ed to PRIVATE_PORT List containers Pull an image or a repository to the docker registry server Push an image or a repository to the docker registry server
restart Restart a running container rm rmi run start stop tag Remove a container Remove an image Run a command in a new container Start a stopped container Stop a running container Tag an image into a repository
version Show the docker version information wait Block until a container stops, then print its exit code
Docker on Docker
(v0.6)
Changes to the container can be committed to the central index or rolled back
Awesomeness!
Develop the box in layers Use only one Linux Kernel Deploy quickly Build Once, Run Anywhere
Questions?
Locate this session at the DrupalCon Prague website: https://prague2013.drupal.org/node/388
@ricardoamaro
@ricardoamaro
Locate this session at the DrupalCon Prague website: https://prague2013.drupal.org/node/388
THANK YOU!