142 Debian.Deb 銀河系唯一の Debian 専門誌 LXC

Similar documents
Evalution of Linux Container(LXC) on Embedded Linux 株式会社富士通コンピュータテクノロジーズ町田裕樹 1201ka01 Copyright 2013 FUJITSU COMPUTER TECHLONOGIES LIMITED

東京エリアDebian勉強会 debootstrapを有効活用してみよう

174 Debian.Deb 銀河系唯一の Debian 専門誌 /usr Merge

1 Debian Debian nabaua dictoss Roger Shimizu koedoyoshida

第173回東京エリアDebian勉強会   grml-debootstrapを用いた USB起動メモリの作成

Xen入門 ppt

Xen入門 ppt

東京エリアDebian勉強会 - systemd

Debian GNU/kFreeBSDで暮らせる環境を構築してみる - 第38回関西Debian勉強会

Add-onアプリケーション開発 - 環境構築マニュアル -

UNIX

東京エリアDebian勉強会 - 第91回 2012年9月度/OSC2012 Tokyo/Fall)

bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows bash on Ubuntu on Windows ˆ Windows10 64bit Wi

東京エリアDebian勉強会 Debian JP Project - OSC 2017 Tokyo/Fall (第154回出張勉強会)

unix.dvi

スライド 1

Linux XScreenSaver T020074

E2 Spider 2018/08/03 Intel NUC Core i7 PC 2.5 /M.2 SSD BOXNUC7I7BNH PC DDR4-2133(PC ) 8GBX2 260pin 1.2V CL15 SP016GBSFU213B22 WD SSD M /51

Raspberry Pi 2 Model B に Debian Jessie / armhf をインストールする - 第125回 2015年3月度

東京エリアDebian勉強会   Buffalo Linkstation向け Debian Installer - 第139回 2016年5月度

Raspberry Pi3 / arm64 - Debian/Ubuntu ミートアップ in 札幌

debian_install.dvi

Dockerの商用サービスでの利用事例紹介

RouteMagic Controller( RMC ) 3.6 RMC RouteMagic RouteMagic Controller RouteMagic Controller MP1200 / MP200 Version 3.6 RouteMagic Controller Version 3

RouteMagic Controller RMC-MP200 / MP Version

HA8000-bdシリーズ RAID設定ガイド HA8000-bd/BD10X2

DocuWide 2051/2051MF 補足説明書

N Express5800/R320a-E4 N Express5800/R320a-M4 ユーザーズガイド

Express5800/R320a-E4, Express5800/R320b-M4ユーザーズガイド

syspro-0405.ppt

東京エリア Debian 勉強会 - 資料

Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

プレゼンテーション

Express5800/320Fc-MR

3 Ubuntu Linux Ubuntu Linux Debian Linux DistroWatch.com 1 Debian Ubuntu Linux 1 Debian CD(4.1 ) Knoppix Debian CentOS Linux CentOS 1 Ubuntu L

Docker Haruka Iwao Storage Solution Architect, Red Hat K.K. February 12, 2015

1 138

Ansible

RouteMagic Controller RMC-MP200 / MP Version

28 Docker Design and Implementation of Program Evaluation System Using Docker Virtualized Environment

Express5800/R320a-E4/Express5800/R320b-M4ユーザーズガイド

% finger apt-get kernel-package, libc6-dev, gcc, make, bin86, bzip2, libdb3-dev, libncurses-dev, fakeroot

debian_manual.dvi

Express5800/R110a-1Hユーザーズガイド

MOTIF XF 取扱説明書

Express5800/320Fa-L/320Fa-LR


Fortigate Ver.4.0MR3Patch12 Information 1

dvi

Ubuntu Linux PC Ubuntu Linux (14.04 LTS, Trusty Tahr) 32bit CD 64bit CD 2. 32bit CPU 64bit 32bit PC CPU 32bit 64bit Windows 64bit 64bit. 32bit Core 64

/

HITACHI Gigabit Fibre Channel (SUSE Linux Enterprise Server IOCard-FP2-Z-199(1)

HA8000シリーズ ユーザーズガイド ~BIOS編~ HA8000/RS110/TS10 2013年6月~モデル

KNOPPIX/Math ( ) MathLibre 2012dojo

Microsoft Word - AFT_3TB_HDD_install_guide doc

FortiGate Ver.4.0MR3Patch14 Information 1

Microsoft Word - PSB導入ガイド_ docx

Express5800/320Fa-L/320Fa-LR/320Fa-M/320Fa-MR

Introduction Purpose This training course describes the configuration and session features of the High-performance Embedded Workshop (HEW), a key tool

fx-9860G Manager PLUS_J

Microsoft Word - Live Meeting Help.docx

<Documents Title Here>

東京エリアDebian勉強会 - 第75回 2011年5月度

US40cユーザーズガイド

NSR-500 Software Update Installation Procedures

untitled

④辻修平_37-48.smd

Oracle Application Server 10g( )インストール手順書

Oracle Application Server 10g(9

Red Hat Enterprise Linux ES (v. 3)

DCL intro Manual for Ubuntu11.10

CLUSTERPRO ファイルサーバ監視オプション編

大統一Debian勉強会 gdb+python拡張を使ったデバッグ手法

1. OS のインストール 今回インストールするのは, Ubuntu という Linux ディストリビューションの中の一つ. OS, ディストリビューションの種類 ディストリビューションとは, 一般利用者が導入 利用するために多くのコンポーネントをまとめた頒布形態. 無料のものと有料のものがあり,

Transcription:

142 Debian.Deb 銀河系唯一の Debian 専門誌 LXC 2016 8 20

1 Debian 2 1.1 141 Debian............ 2 2 3 2.1 mkouhei.......... 3 2.2 dictoss........... 3 2.3............. 3 2.4 kenhys........... 3 2.5 koedoyoshida....... 3 2.6 yy y ja jp......... 3 3 Debian Trivia Quiz 4 4 Debian lxc 5 4.1........... 5 4.2..... 5 4.3 lxc........... 6 4.4 lxc........ 9 4.5........... 10 4.6........... 10 1

142 Debian 2016 8 1 Debian 1.1 141 Debian 2016 7 16 ( ) 141 Debian 12 Roger Debian Installer Screen yutannihilation go-apt-cacher/mirror 2 Roger Debian Installer Screen Debconf16 Debian Installer screen Debian Installer udeb udeb Debian Installer Stretch Alpha 7 yutannihilation go-apt-cacher/mirror apt Go *1 apt apt-mirror apt *2 go-apt-cacher/mirror *1 https://github.com/cybozu-go/aptutil *2 2

142 Debian 2016 8 2 : 1. (LXC/LXD/Docker/etc) 2. 3. Hack Time 2.1 mkouhei 1. 2. LXC 3. 2.4 kenhys 1. 2. Docker 3. 2.2 dictoss 1. 2. lxc 3. preseed kfreebsd 2.5 koedoyoshida 1. 2. LXC,Docker chroot 3. 2.3 1. 2. ( ) 3..deb 2.6 yy y ja jp 1. 2. cowbuilder? 3. DDTSS? 3

142 Debian 2016 8 3 Debian Trivia Quiz Debian Quiz debian-devel-announce@lists.debian.org debian-news@lists.debian.org 1. unstable GCC Transition Transition A 5.4 B 6.1 C 7.0 2. unstalbe perl Transition Transition A 5.22 B 5.24 C 6.0 3. Linux Kernel LTS(=LongTermSupport) A 4.8 B 4.9 C 4.10 4

142 Debian 2016 8 4 Debian lxc 4.1 1 lxc 4.2 4.2.1 OpenVZ LXC API OS (= OS ) Xen ( ) OS QEMU VirtualBox ( ) OS CPU KVM 4.2.2 CPU OS OS 5

*3 4.2.3 chroot chroot *4 rootfs(= ) chroot(2) chroot(3) 4.3 lxc 4.3.1 lxc lxc *5 (=rootfs) lxc IP 1 4.3.2 lxc Debian GNU/Linux 8 Jessie amd64 lxc Debian Project https://wiki.debian.org/lxc https://wiki.debian.org/lxc/simplebridge lxc # apt-get install lxc bridge-utils libvirt-bin lxc lxc-* $ ls /usr/bin/lxc* /usr/bin/lxc-attach /usr/bin/lxc-start /usr/bin/lxc-test-list /usr/bin/lxc-autostart /usr/bin/lxc-start-ephemeral /usr/bin/lxc-test-locktests /usr/bin/lxc-cgroup /usr/bin/lxc-stop /usr/bin/lxc-test-lxcpath /usr/bin/lxc-checkconfig /usr/bin/lxc-test-apparmor /usr/bin/lxc-test-may-control /usr/bin/lxc-clone /usr/bin/lxc-test-attach /usr/bin/lxc-test-reboot /usr/bin/lxc-config /usr/bin/lxc-test-autostart /usr/bin/lxc-test-saveconfig /usr/bin/lxc-console /usr/bin/lxc-test-cgpath /usr/bin/lxc-test-shutdowntest /usr/bin/lxc-create /usr/bin/lxc-test-clonetest /usr/bin/lxc-test-snapshot /usr/bin/lxc-destroy /usr/bin/lxc-test-concurrent /usr/bin/lxc-test-startone /usr/bin/lxc-device /usr/bin/lxc-test-console /usr/bin/lxc-test-symlink /usr/bin/lxc-execute /usr/bin/lxc-test-containertests /usr/bin/lxc-unfreeze /usr/bin/lxc-freeze /usr/bin/lxc-test-createtest /usr/bin/lxc-unshare /usr/bin/lxc-info /usr/bin/lxc-test-destroytest /usr/bin/lxc-usernsexec /usr/bin/lxc-ls /usr/bin/lxc-test-device-add-remove /usr/bin/lxc-wait /usr/bin/lxc-monitor /usr/bin/lxc-test-get_item /usr/bin/lxc-snapshot /usr/bin/lxc-test-getkeys libvirt-bin libvirtd 192.168.122.0/24 NAT NAT 192.168.122.1(=virbr0) * 6 lxc cgroups *3 raw loopback *4 chroot 1982 ( ) *5 LinuX Containers lxc *6 VPS NAT (= ) 6

# vi /etc/fstab cgroup /sys/fs/cgroup cgroup defaults 0 0 # mount /sys/fs/cgroup # mount grep cgroups cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr, release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd) lxc lxc-checkconfig enabled disable # lxc-checkconfig Kernel configuration not found at /proc/config.gz; searching... Kernel configuration found at /boot/config-3.16.0-4-amd64 --- Namespaces --- Namespaces: enabled Utsname namespace: enabled Ipc namespace: enabled Pid namespace: enabled User namespace: enabled 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 4.3.3 :lxc-create (=rootfs) lxc-create lxc Debian GNU/Linux 8 Jessie amd64 *7 debstudy1 # LANG=C SUITE=jessie MIRROR=http://ftp.jp.debian.org/debian lxc-create -n debstudy1 -t debian debootstrap is /usr/sbin/debootstrap Checking cache download in /var/cache/lxc/debian/rootfs-jessie-amd64... Copying rootfs to /var/lib/lxc/debstudy1/rootfs...generating locales (this might take a while)... Generation complete. insserv: warning: current start runlevel(s) (empty) of script checkroot.sh overrides LSB defaults (S). insserv: warning: current stop runlevel(s) (S) of script checkroot.sh overrides LSB defaults (empty). insserv: warning: current start runlevel(s) (empty) of script checkroot.sh overrides LSB defaults (S). update-rc.d: error: umountfs Default-Start contains no runlevels, aborting. insserv: warning: current start runlevel(s) (empty) of script hwclock.sh overrides LSB defaults (S). insserv: warning: current stop runlevel(s) (0 6 S) of script hwclock.sh overrides LSB defaults (0 6). update-rc.d: error: cannot find a LSB script for hwclockfirst.sh Creating SSH2 RSA key; this may take some time... 2048 df:99:56:34:c7:6d:d1:0a:2d:e2:b4:6a:fd:a0:62:f5 /etc/ssh/ssh_host_rsa_key.pub (RSA) Creating SSH2 DSA key; this may take some time... 1024 9d:42:45:1d:fd:03:92:04:6c:e0:fb:e6:06:cc:07:06 /etc/ssh/ssh_host_dsa_key.pub (DSA) Creating SSH2 ECDSA key; this may take some time... 256 6a:4a:1a:6f:27:59:33:6c:58:5c:58:27:03:08:3b:ea /etc/ssh/ssh_host_ecdsa_key.pub (ECDSA) Creating SSH2 ED25519 key; this may take some time... 256 36:d6:9b:d3:9d:96:a4:af:af:8c:75:11:90:76:56:75 /etc/ssh/ssh_host_ed25519_key.pub (ED25519) Failed to read /proc/cmdline. Ignoring: No such file or directory invoke-rc.d: policy-rc.d denied execution of start. Current default time zone: Asia/Tokyo Local time is now: Sun Jul 10 13:26:07 JST 2016. Universal Time is now: Sun Jul 10 04:26:07 UTC 2016. Root password is Won4EiUa, please change! lxc-create /var/lib/lxc/debstudy1 rootfs lxc rootfs *7 linux 7

(2 Debian ) # ls -l /var/lib/lxc/debstudy1 8 -rw-r--r-- 1 root root 479 7 10 13:26 config -rw-r--r-- 1 root root 0 7 10 13:26 fstab drwxr-xr-x 22 root root 4096 7 10 13:26 rootfs # ls /var/lib/lxc/debstudy1/rootfs bin boot dev etc home lib lib64 media mnt opt proc root run sbin selinux srv sys tmp usr var lxc # cat /var/lib/lxc/debstudy1/config # Template used to create this container: /usr/share/lxc/templates/lxc-debian # Parameters passed to the template: # For additional config options, please look at lxc.container.conf(5) lxc.network.type = empty lxc.rootfs = /var/lib/lxc/debstudy1/rootfs # Common configuration lxc.include = /usr/share/lxc/config/debian.common.conf # Container specific configuration lxc.mount = /var/lib/lxc/debstudy1/fstab lxc.utsname = debstudy1 lxc.arch = amd64 lxc.autodev = 1 lxc.kmsg = 0 config # vi /var/lib/lxc/debstudy1/config ( ) lxc.network.type = veth lxc.network.flags = up lxc.network.link = virbr0 lxc.network.name = eth0 lxc.network.ipv4 = 192.168.122.203/24 lxc.network.ipv4.gateway = 192.168.122.1 4.3.4 :lxc-ls lxc-ls # lxc-ls debstudy1 4.3.5 :lxc-destroy lxc-destroy # lxc-destroy -n <lxc-name> 4.3.6 :lxc-start lxc-start init -d -d lxc-start # lxc-start -n debstudy1 # lxc-start -n debstudy1 -d 4.3.7 :lxc-stop lxc-stop init init 8

# lxc-stop -n debstudy1 4.3.8 :lxc-console lxc-console Ctrl+a q # lxc-console -n debstudy1 Connected to tty 1 Type <Ctrl+a q> to exit the console, <Ctrl+a Ctrl+a> to enter Ctrl+a itself Debian GNU/Linux 8 debstudy1 tty1 debstudy1 login: 4.4 lxc 4.4.1 lxc lxc ssh lxc debian lxc-create rootfs openssh-server lxc-create config IP chroot rootfs ( lxc-start ) passwd root adduser apt-get install sudo vim-tiny visudo dpkg-reconfigure locales ( lxc-create LANG ) lxc-start -n {lxc-name} -d ssh IP ssh sudo 9

4.4.2 lxc lxc ( ) python2 python3 web 1 (debian libapache2-mod-wsgi libapache2-mod-wsgi-py3 ) systemd sysvinit (systemd ) * 8*9 amd64 i386 CPU * 10 4.5 Debian GNU/Linux lxc lxc lxc LXD docker 4.6 LXC https://linuxcontainers.org/ LXC - Debian Wiki https://wiki.debian.org/lxc (2013) debootstrap http://tokyodebian.alioth.debian.org/pdf/ debianmeetingresume201304.pdf *8 debian *9 debian pbuilder cowbuilder rootfs chroot debian *10 cross debootstrap QEMU 10

Debian 2016 8 20 1 Debian 11