INTRODUCTION TO LINUX CONTAINTER (LXC) AND DOCKER - Red Hat

11m ago
25 Views
1 Downloads
587.92 KB
24 Pages
Last View : 3d ago
Last Download : 3m ago
Upload by : Jenson Heredia
Transcription

INTRODUCTION TO LINUX CONTAINTER (LXC) AND DOCKER Michael Lessard. RHCA Senior Solutions Architect, Red Hat michaellessard January 2014 1 LXC DOCKER MICHAEL LESSARD

A bit of history – Virtualization and containers Chroot (version 7 Unix, 1979) FreeBSD Jails (FreeBSD 4, 2000) Linux vserver (Linux, Oct 2001) Para-virtualization Xen (Linux, 2003) Solaris zones (Solaris 10, 2004) OpenVZ (Linux, 2005) Full virtualization KVM (Linux, 2007) Linux Containers - LXC (Linux 2.6.29 2009) In red – Virtualization on the os level (containers) 2 LXC DOCKER MICHAEL LESSARD

What is LXC ? An operating system-level virtualization Light weight virtualization Containers Relies on cgroup,selinux and namespace Included in the kernel 3 Can be managed using libvirt-lxc (RHEL and Fedora) or lxc-tools (Fedora) Perceived near bear metal performance LXC DOCKER MICHAEL LESSARD

4 LXC DOCKER MICHAEL LESSARD

Uses cases 5 Lightweight web servers Testing environment Application isolation Low latency app LXC DOCKER MICHAEL LESSARD

Weaknesses Locked into running the host kernel 6 Unlike a fully virtualized machine, you are restricted to the kernel running on the host No Windows support LXC DOCKER MICHAEL LESSARD

Demo 7 LXC DOCKER MICHAEL LESSARD

DEMO WITH LIBVIRT LXC (FEDORA) # yum install lxc libvirt-daemon-driver-lxc # sytemctl restart libvirtd Demo lxc container1 and container2 Demo virt-sandbox Demo Docker 8 LXC DOCKER MICHAEL LESSARD

DEMO USING VIRT-MANAGER 9 LXC DOCKER MICHAEL LESSARD

10 LXC DOCKER MICHAEL LESSARD

11 LXC DOCKER MICHAEL LESSARD

12 LXC DOCKER MICHAEL LESSARD

13 LXC DOCKER MICHAEL LESSARD

14 LXC DOCKER MICHAEL LESSARD

15 LXC DOCKER MICHAEL LESSARD

LXC DEMO USING THE COMMAND LINE # virsh uri qemu:/// session # export VIRSH DEFAULT CONNECT URI lxc:/// # virsh uri lxc:/// 16 LXC DOCKER MICHAEL LESSARD

VALIDATE LXC CAPABILITIES # virsh capabilities 17 LXC DOCKER MICHAEL LESSARD

CONFIGURE A CONTAINER # vi lxc example.xml domain type 'lxc' name lxc example /name memory 500000 /memory os type exe /type init /bin/sh /init /os vcpu 1 /vcpu clock offset 'utc'/ on poweroff destroy /on poweroff on reboot restart /on reboot on crash destroy /on crash devices emulator /usr/libexec/libvirt lxc /emulator interface type 'network' source network 'default'/ /interface console type 'pty' / /devices /domain 18 LXC DOCKER MICHAEL LESSARD

DEFINE AND START THE CONTAINER # virsh define lxc example.xml # virsh start lxc example # virsh list # virsh dominfo lxc example # virsh console lxc example 19 LXC DOCKER MICHAEL LESSARD

DEMO WITH VIRTSANDBOX - HTTPD # yum install libvirt-sandbox httpd # systemctl restart libvirtd # virt-sandbox-service create -C --network dhcp -u httpd.service httpd # systemctl start httpd sandbox # virt-sandbox-service connect httpd # dhclient eth0 # ifconfig Point browser on http://(ip-address) note : /var/lib/libvirt/filesystems 20 LXC DOCKER MICHAEL LESSARD

NEXT STEP 21 LXC DOCKER MICHAEL LESSARD

DOCKER Container-based tooling High level tool for LXC Portable deployment across machines Public shared containers Automatic build Tool ecosystem (nova, salt, chef, puppet, jenkins, openshift .) And more . http://docker.io 22 LXC DOCKER MICHAEL LESSARD

DOCKER DEMO (Fedora 20) # yum install docker-io # sytemctl start docker ; systemctl enable docker # docker search ubuntu # docker pull ubuntu # sudo docker run ubuntu apt-cache search memcached # docker search arch # docker pull base/arch # docker run base/arch pacman -Ss memcached # docker images # docker run -i -t ubuntu /bin/bash # docker ps -a # docker rmi base/arch 23 LXC DOCKER MICHAEL LESSARD

2 LXC DOCKER MICHAEL LESSARD A bit of history - Virtualization and containers Chroot (version 7 Unix, 1979) FreeBSD Jails (FreeBSD 4, 2000) Linux vserver (Linux, Oct 2001) Para-virtualization Xen (Linux, 2003) Solaris zones (Solaris 10, 2004) OpenVZ (Linux, 2005) Full virtualization KVM (Linux, 2007) Linux Containers - LXC (Linux 2.6.29 2009)

Related Documents:

Linux in a Nutshell Linux Network Administrator’s Guide Linux Pocket Guide Linux Security Cookbook Linux Server Hacks Linux Server Security Running Linux SELinux Understanding Linux Network Internals Linux Books Resource Center linux.oreilly.comis a complete catalog of O’Reilly’s books on Linux and Unix and related technologies .

Linux Containers and LXC, a user-space control package for Linux Containers, constitute the core of Docker. LXC uses kernel-level namespaces to isolate the container from the host. The user namespace separates the container's and the host's user database, thus ensuring that the contain

Other Linux resources from O’Reilly Related titles Building Embedded Linux Systems Linux Device Drivers Linux in a Nutshell Linux Pocket Guide Running Linux Understanding Linux Network Internals Understanding the Linux Kernel Linux Books Resource Center linu

Perfection PC Perfection PC Inc. Philips Philips Electronics Planar Planar Systems Inc PLEXON Plexon, Inc. Pogo Linux Pogo Linux, Inc. Pogo Linux Altura M2 Pogo Linux, Inc. Pogo Linux Velocity -D50 Pogo Linux, Inc. Pogo Linux Verona 330 Pogo Linux, Inc. Pogo Linux Vor

Official Kali Linux Documentation This PDF has been autogenerated on docs.kali.org - Apr 7, 2013 00. Introduction to Kali Linux What is Kali Linux ? Kali Linux is an advanced Penetration Testing and Security Auditing Linux distribution. Kali Linux Features Kali is a complete re-build of BackTrack Linux, adhering completely to Debian development .

Yes. Oracle Autonomous Linux, which is based on Oracle Linux, is 100% application binary compatible with IBM's Red Hat Enterprise Linux. This means that applications certified to run on Red Hat Enterprise Linux can run on Oracle Autonomous Linux unmodified. Oracle Linux binaries are provided for patching and updating Red Hat Enterprise Linux

Chapter 23 – Linux Security. 2 Outline Introduction Linux Security Model Linux File-System Security Linux Vulnerabilities Linux System Hardening Application Security Mandatory Access Controls. 3 Introduction Linux –Unix like computer OS that uses Linux kernel created by LinusTorvaldsin 1991 evolved into a popular alternative to Win and MAC OS has .

enFakultätaufAntragvon Prof. Dr. ChristophBruder Prof. Dr. DieterJaksch Basel,den16. Oktober2012, Prof. Dr .