DockerでGentooのテスト

03317f5624d43c689ba1f2a76fbde47e?s=47 naota
July 05, 2014

 DockerでGentooのテスト

03317f5624d43c689ba1f2a76fbde47e?s=128

naota

July 05, 2014
Tweet

Transcript

  1. Docker Ͱςετ͢Δ ੨ా௚େ 2014-07-05 ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 1 /

    16
  2. ebuild ॻ͍ͯ·͔͢ ebuild ॻ͘ͷָͰͱͯ΋͍͍Ͱ͢Ͷ ͪΌΜͱςετͯ͠·͔͢ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 2

    / 16
  3. ςετͷํ๏ repoman build ͯ͠ΈΔ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 3 /

    16
  4. repoman repoman full ͢Δͱ ebuild ͷจ໘ΛνΣ οΫͯ͘͠ΕΔ ͜ͷ package ͸

    RDEPEND ʹೖͬͯΔ͚Ͳɺ΄Μͱʹ? DEPEND ͩ ͚Ͱ͍͍Μ͡Όͳ͍ͷɻͱ͔΋ݴͬͯ͘ΕΔ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 4 / 16
  5. build ͯ͠ΈΔ build ͯ͠ΈΔͱ͍Ζ͍Ζͱ Portage ͕Ϗϧυ࣌νΣ οΫΛͯ͘͠ΕΔ ͚ΕͲ΋ ੨ా௚େ Docker

    Ͱςετ͢Δ 2014-07-05 5 / 16
  6. ઃఆ͕ඞཁ FEATURES=test ύοέʔδ಺ͷςετϓϩάϥϜΛ࣮ߦ PORTAGEELOGCLASSES="${PORTAGEELOGCLASSES} qa" ༷ʑͳ QA ͷϩάग़ྗ CFLAGS,CXXFLAGS,FFLAGS,FCFLAGS ͷ

    શͯ ʹ "-frecord-gcc-switches" ΛೖΕΔ gcc ͷ CFLAGS ΛόΠφϦʹه࿥ ͪΌΜͱ CFLAGS ͕൓ө͞Ε͍ͯΔ͔Ͳ͏͔ΛνΣ οΫͯ͘͠ΕΔ ld.gold Λ࢖͏ underlinking Λ;͙ͤ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 6 / 16
  7. QA ͷྫ SONAME missing .so ϑΝΠϧʹ SONAME ͱ͍͏஋͕ઃఆ͞Ε͍ͯͳ͍ ϦϯΧ͕ϦϯΫΛߦͳ͏࣌ʹ༻͍Δ (͋ͬͨํ͕Α͍)

    world writable setuid binary ΍͹͍ RUNPATHɾEXECSTACK RUNPATH: shared object ͷ lookup ઌ: /tmp ͱ͔ೖͬͯͳ͍? EXECSTACK: ࣮ߦՄೳͳελοΫ: มͳίʔυೖΕΒΕͳ͍? ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 7 / 16
  8. ͜Ε͚ͩͰ͍͍ͷ? ຊ౰ʹ ͦΕͰ Ͳ͜Ͱ΋ ϏϧυͰ͖ΔͷͩΖ͏͔? DEPEND ʹೖͬͯͳ͍΋ͷ͕͋Δ͔΋? ͨ·ͨ·ࣗ෼ͷ؀ڥʹ͸ೖ͍ͬͯͨʜͱ͍͏Φν Ͳ͏΍ͬͯςετͨ͠Β͍͍? stage3

    ͷ·ͬ͞Βͳ؀ڥ͔Β ΊΜͲ͘ͳ͍ɾ ɾ ɾ? ؀ڥ͍͍ͪͪ࡞Δͷ? ຖճ࠷ॳ͔ΒશͯίϯύΠϧ͢Δͷ? ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 8 / 16
  9. Docker Λ࢖͓͏ Docker ͱ͸ͳʹ͔ -> ͍·͞ΒͳͷͰলུ ίϯςφΛ࢖ͬͨԾ૝؀ڥ kernel ͸ڞ௨ͰϦιʔε੍ݶ͸Ͱ͖Δ ϓϩηεۭؒͱ͔ผ

    chroot ͷͭΑ͍΍ͭ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 9 / 16
  10. Docker Ͱ Gentoo ؀ڥ git clone https://github.com/naota/dockergentoo export MAINTAINER="Naohiro Aota

    <naota@gentoo.org>" ./bin/update.sh Docker ͷ stage3 ؀ڥͱ Portage πϦʔ؀ڥ͕Ͱ͖ΔΑ! ಉ͡Α͏ʹ distfiles ؀ڥ΋࡞Δ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 10 / 16
  11. ུ֓ਤ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 11 / 16

  12. Docker Ͱ emerge ͢Δ ./bin/build-package.sh <flag> <package> ./bin/build-package.sh ’app-editors/emacs +X’

    ’app-editors/emacs’ ./bin/build-package.sh ” ’pficommon’ (ࣗ෼ͷ؀ڥʹ͋Δ) ࠷৽ͷ stage3 ͱ Portage πϦʔΛ࢖ͬͯɺUSE ϑϥάΛઃఆͯ͠ɺemerge ͕૸Δ ίϯςφΠϝʔδ͸ࣗಈফڈʹ͍ͯ͠Δ ࣗ෼Ͱফڈ͢ΔखؒΛল͘ emerge ͕੒ޭͨ͠ -> ͓ΊͰͱ͏͍͟͝·͢ ಉ࣌ʹόΠφϦ͕࡞ΒΕ͍ͯΔͷͰɺޙͷ emerge ͸ޮ཰తʹͳΔ emerge ͕ࣦഊͨ͠ -> ݪҼΛௐ΂͍ͨΑͶ results/ͷԼʹ/var/tmp/portage Λ tar.xz ͨ͠΋ͷ͕ೖͬͯΔ unpack ͯ͠޷͖ͳ͚ͩݪҼΛ୳ΕΔ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 12 / 16
  13. ࣗ෼ͷ ebuild Λςετ͢Δ ./bin/test-ebuild.sh ’gwaei +hunspell’ gwaei-3.6.2.ebuild ίϯςφͷதͰࢦఆͨ͠ ebuild ͚ͩΛ

    overlay ʹ͍Εͯ emerge ͯ͠ ͘ΕΔ ࣗ෼Ͱॻ͍ͨ ebuild Λςετ͢Δͷʹ࠷ద ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 13 / 16
  14. ͼΈΐ͏ʹ΍Γ͍ͨ͜ͱ͕͋Δ USE ϑϥάΛཱͯΔ͚ͩͰ͸଍Γͳ͍ ./bin/shell.sh gwaei-3.6.2.ebuild overlay Λ࡞ͬͯίϯςφͷதͰ shell ͕ىಈ͞ΕΔ emerge

    ͷલʹ͍ͨ͜͠ͱΛ͍Ζ͍Ζͯ͠ /build/dockerbuild.sh <flag> <package> ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 14 / 16
  15. কདྷతʹ portage πϦʔͷதͷ΋ͷΛ͔ͨͬͺ͔͠ΒϏϧυ ͳΜ͔΋͏΍ͬͯΔਓ͕͍ΔͬΆ͍? Python ͔ͳΜ͔Ͱॻ͖௚͢ ebuild Λ upload ͯ͠ςετͯ͘͠ΕΔ

    Web αʔϏε distfiles Λෳ਺ϚγϯͰڞ༗ ϏϧυΩϡʔΛ࡞ͬͯ෼ۀͱ͔ ੨ా௚େ Docker Ͱςετ͢Δ 2014-07-05 15 / 16
  16. ·ͱΊ ΫϦʔϯͳ؀ڥͰϏϧυͰ͖Δ dockergentoo Λ࡞ͬͨΑ https://github.com/naota/dockergentoo ॻ͍ͨ ebuild ΛΫϦʔϯʹςετͰ͖ΔΑ όΠφϦΛ࡞͓͍ͬͯͯ͘ΕΔͷͰԿ౓΋Ϗϧυ͠ͳ͓͞ͳ͍Α ੨ా௚େ

    Docker Ͱςετ͢Δ 2014-07-05 16 / 16