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

僕とHaconiwa /haconiwa-intro

KONDO Uchio
August 29, 2016

僕とHaconiwa /haconiwa-intro

KIXS #0 LT 大会にて
https://kixs.doorkeeper.jp/events/49820

KONDO Uchio

August 29, 2016
Tweet

More Decks by KONDO Uchio

Other Decks in Technology

Transcript

  1. Πϯετʔϧ w QBDLBHFDMPVE͔Βམͱͤ·͢ɻ؆୯Ͱ͢Ͷʂ
 IUUQTQBDLBHFDMPVEJPVE[VSBIBDPOJXBJOTUBMM # example for deb-ish distro curl

    -s https://packagecloud.io/install/repositories/udzura/ haconiwa/script.deb.sh | sudo bash apt-get update apt-get install haconiwa apt-get install lxc # It’s required to bootstrap fs
  2. ࠷ॳʹઃఆϑΝΠϧΛੜ੒͠·͢ $ haconiwa new test.haco assign new haconiwa name =

    haconiwa-0491a405 assign rootfs location = /var/lib/haconiwa/0491a405 create test.haco
  3. TTIEΛΠϯετʔϧͯ͠ةݥͳઃఆΛ͠·͢ Haconiwa.define do |config|
 #...
 config.provision do |p| p.run_shell <<-SHELL

    apk add --update openssh sed -i 's/#Port.*/Port 2222/' /etc/ssh/sshd_config # NOTE: αϯϓϧ͔ͩΒͶʂ sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config sed -i 's/#PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config echo root:r00t | chpasswd ssh-keygen -t rsa -P "" -f /etc/ssh/ssh_host_rsa_key SHELL end #... end
  4. lJOJUzίϚϯυΛTTIEʹม͑ͯɺσʔϞϯԽ͠·͢ Haconiwa.define do |config| # The container name and container's

    hostname: config.name = "haconiwa-0491a405" # The first process when invoking haconiwa run: # config.init_command = "/bin/bash" # To: config.init_command = %w(/usr/sbin/sshd -D) # And uncomment: config.daemonize!
 #...
 end $ haconiwa run test.haco
  5.