Upgrade to Pro — share decks privately, control downloads, hide ads and more …

コンテナは友だち! /friends-who-are-good-at-containers

KONDO Uchio
September 14, 2017

コンテナは友だち! /friends-who-are-good-at-containers

2017年 pepabo 新卒エンジニア座学

----
追記・修正
p.16 LXDはGo言語で開発されている https://github.com/lxc/lxd

KONDO Uchio

September 14, 2017
Tweet

More Decks by KONDO Uchio

Other Decks in Technology

Transcript

  1. த਎ΛݟͯΈΑ͏ wԋश  ௕͘ଘࡏ͢ΔΑ͏ͳϓϩηεΛ࡞ͬͯΈΑ͏ɻ w  ͦͷϓϩηεͷ1*%Λಛఆ͠Α͏ɻ w  ͦͷϓϩηεʹ͍ͭͯɺҎԼͷ৘ใΛऔಘͯ͠ΈΑ͏ɻ

    w  ΧϨϯτσΟϨΫτϦ IJOUQSPD1*%DXE  w  ؀ڥม਺ IJOUQSPD1*%FOWJSPO  w  ϝϞϦϚοϐϯά IJOUQSPD1*%NBQT  w  εϨουͷ਺ IJOUQSPD1*%UBTL
  2.  Ұ࿈ͷॲཧΛͭͳ͛Δɻॱ൪஫ҙ mkdir -p /sys/fs/cgroup/cpu/7th-engineer unshare --fork --pid --mount --uts

    echo $$ > /sys/fs/cgroup/cpu/7th-engineer/tasks chroot /root/7th-engineer cd / mount -t proc proc /proc hostname 7th-engineer.example bash -l ʮ͓·͡ͳ͍ʯతॲཧΛ௥Ճɻ্͔Βೖྗ࣮ͯ͠ߦͯ͠ΈΑ͏
  3. ԋशͦͷ w  ઌ΄Ͳͷʮࣗ࡞ίϯςφʯʹ͍ͭͯɺ
 ผͷλʔϛφϧ͔ΒϗετʹೖΓɺҎԼΛ͔֬ΊͯΈΑ͏ɻ w  ϗετ͔Βݟͯίϯςφ͕ʮϓϩηεʯͰ͋Δ͜ͱ w 

    1*%ɺ.PVOUɺ654/BNFTQBDF͕෼཭͍ͯ͠Δ͜ͱ w  ίϯςφ಺Ͱ$16Λ͍͘Β࢖ͬͯ΋ɺϗετͷ$16Λ͔͠ ࢖Θͳ͘ͳΔΑ͏ɺDHSPVQΛઃఆͯ͠ΈΑ͏ɻ·ͨɺ֬ೝ͠Α͏
 IJOUIUUQTBDDFTTSFEIBUDPNEPDVNFOUBUJPOKB+13FE@)BU@&OUFSQSJTF@-JOVY IUNM[email protected]@(VJEFTFDDQVIUNM