第3回 コンテナ型仮想化の情報交換会@大阪 で行った発表です。

コンテナ超人みたいな人ばかりで、この内容で発表して良いものやらと思ったのですが、アプリケーションを書く側からの視点で話してきました。
Vagrant ユーザのための Docker 入門
Docker を知った時は、速くなった Vagrant のようなものだと思っていたのですが、色々と見る内にそもそも別のもので、ユースケースとして重なるところはあれど、別のツールだと認識した方が良いです。
Docker の入り口としては、デモを見てもらうのが、手っ取り早いので、そのあたりが伝わったなら良かったです。
Introduction to Docker
発表で引用した「Introduction to Docker」は下記です。公式の資料なので、色々ググる前に、まずはこれを読むのがおすすめです:D
CentOS で Docker を動かす Vagrantfile
デモで使った Docker が動く CentOS を作る Vagrantfile です。
https://github.com/shin1x1/vagrant-centos-docker.git
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "opscode-centos65"
  config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box"
  config.vm.provider :virtualbox do |vb|
    vb.name = "docker"
    vb.customize ["modifyvm", :id, "--memory", 1024]
  end
  config.vm.network :private_network, ip: "192.168.33.10"
  config.vm.network :forwarded_port, guest: 4243, host: 4243
  config.vm.provision :shell, :inline => <<-EOT
    #
    # iptables off
    #
    /sbin/iptables -F
    /sbin/service iptables stop
    /sbin/chkconfig iptables off
    #
    # yum repository
    #
    rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
    yum install -y vim-enhanced telnet
    #
    # docker
    #
    yum install -y docker-io
    sed -i 's,^other_args="",other_args="-H tcp://0.0.0.0:4243 -H unix:// -dns 8.8.8.8",g' /etc/sysconfig/docker
    chkconfig docker on
    service docker restart
  EOT
end
				さいごに
Docker 盛り上がっていますね。
今後、本番環境としての Docker 活用例や、Docker コンテナをそのまま deploy できる DaaS(Docker as a Service)が増えてくると、面白くなりそうです。
なお、Docker が出たから、Vagrant は終わりとかそういう話では無いので、今後も Vagrant も活用していきたいですね。
- Newer: Vagrant体験入門ハンズオンの資料を公開します
- Older: Laravel ユーザなら知っておくべきAuthオートログインのこと



