{"action":"created","issue":{"url":"https://api.github.com/repos/mediba-moritake/docker-rails/issues/1","repository_url":"https://api.github.com/repos/mediba-moritake/docker-rails","labels_url":"https://api.github.com/repos/mediba-moritake/docker-rails/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/mediba-moritake/docker-rails/issues/1/comments","events_url":"https://api.github.com/repos/mediba-moritake/docker-rails/issues/1/events","html_url":"https://github.com/mediba-moritake/docker-rails/issues/1","id":162331493,"number":1,"title":"Dockerによる環境構築 所感","user":{"login":"mediba-Kitada","id":5426530,"avatar_url":"https://avatars.githubusercontent.com/u/5426530?v=3","gravatar_id":"","url":"https://api.github.com/users/mediba-Kitada","html_url":"https://github.com/mediba-Kitada","followers_url":"https://api.github.com/users/mediba-Kitada/followers","following_url":"https://api.github.com/users/mediba-Kitada/following{/other_user}","gists_url":"https://api.github.com/users/mediba-Kitada/gists{/gist_id}","starred_url":"https://api.github.com/users/mediba-Kitada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediba-Kitada/subscriptions","organizations_url":"https://api.github.com/users/mediba-Kitada/orgs","repos_url":"https://api.github.com/users/mediba-Kitada/repos","events_url":"https://api.github.com/users/mediba-Kitada/events{/privacy}","received_events_url":"https://api.github.com/users/mediba-Kitada/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-06-26T15:03:04Z","updated_at":"2016-06-28T11:23:57Z","closed_at":"2016-06-28T11:23:57Z","body":"## opinion\r\n\r\n### コンテナはミドルウェア単位で構築、保守する案\r\n\r\n- アプリケーションの開発においては、必要なコンテナをローカルで起動させ、開発\r\n- ベースとするイメージ(OSのディストリビューション)は、[Alpine Linux](http://www.alpinelinux.org/)\r\n- 例:\r\n    - mediba/php-fpm:5.6\r\n        - cgi版PHPで構築するアプリケーションに必要なphp-fpm及びPHP拡張パッケージがインストールされているDockerイメージ\r\n    - mediba/mod_php:5.6\r\n        - module版PHPで構築するアプリケーションに必要なApache、PHP拡張パッケージがインストールされているDockerイメージ\r\n    - mediba/ruby:2.3\r\n        - Rubyで構築するアプリケーションに必要なミドルウェアとbundlerがインストールされているDockerイメージ。gemは、Gemfileで指定、保守\r\n    - mediba/nginx:latest\r\n        - nginxのmainlineが稼働しているDockerイメージ。設定ファイル(```/etc/nginx.conf```)はサンプルとしてリポジトリに格納\r\n    - mediba/mysql-server:latest\r\n    - mediba/memcached:latest\r\n    - mediba/redis:latest\r\n    - etc etc\r\n\r\n#### 課題\r\n\r\n- 環境に関わらず、マルチコンテナは必須となるので、開発チームの学習コストを払う必要がある\r\n- コンテナ単位が責任単位となる\r\n\r\n## memo\r\n\r\n- VirtualBoxをアップデート\r\n    - http://download.virtualbox.org/virtualbox/5.0.22/VirtualBox-5.0.22-108108-OSX.dmg \r\n    - dmgをマウントし、installerを用いてインストール\r\n\r\n```\r\n% sudo installer -pkg /Volumes/VirtualBox/VirtualBox.pkg\r\n```\r\n\r\n- Docker for Macをインストール\r\n    - https://docs.docker.com/docker-for-mac/\r\n    - 試運転\r\n\r\n```zsh\r\n% docker version\r\nClient:\r\nVersion:      1.12.0-rc2\r\nAPI version:  1.24\r\nGo version:   go1.6.2\r\nGit commit:   906eacd\r\nBuilt:        Fri Jun 17 20:35:33 2016\r\nOS/Arch:      darwin/amd64\r\nExperimental: true\r\n\r\nServer:\r\nVersion:      1.12.0-rc2\r\nAPI version:  1.24\r\nGo version:   go1.6.2\r\nGit commit:   a7119de\r\nBuilt:        Fri Jun 17 22:09:20 2016\r\nOS/Arch:      linux/amd64\r\nExperimental: true\r\n```\r\n\r\n- [docker-rails](https://github.com/mediba-moritake/docker-rails)のコンテナを起動してみる\r\n\r\n```zsh\r\n# dockerイメージのビルド 所要時間も図ってみる\r\n% time docker build -t docker-rails .\r\nSuccessfully built e3ae18d2dae1\r\ndocker build -t docker-rails .  0.29s user 0.29s system 0% cpu 4:51.41 total\r\n\r\n# dockerコンテナを起動し、shellプロセスを起動\r\n% docker run -it --name \"docker-rails\" docker-rails /bin/bash\r\nroot@de439e1cc03e:/myapp# exit\r\nexit\r\n## shellプロセスを終了するとdockerコンテナも停止\r\n[kitatuba@Tsubasas-Mac-mini] 16-06-26 15:39:30 (git)-[master] ~/project/docker-rails/docker-rails\r\n% sudo docker ps -a\r\nCONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES\r\nde439e1cc03e        docker-rails        \"/bin/bash\"         30 seconds ago      Exited (0) 2 seconds ago                       docker-rails\r\n\r\n# dockerコンテナをバックグラウンドプロセスとして起動(detach)\r\n% docker run -d --restart=no --name \"docker-rails\" docker-rails /bin/ping localhost\r\n05d36c2bcd84de25752abc0704103b37e83401522b66bb268f74f8990951bc39\r\n## detachしたコンテナにshellプロセスを起動してログイン\r\n% docker exec -it docker-rails /bin/bash\r\n## mysql-serverは稼働してない\r\nroot@05d36c2bcd84:/myapp# apt list |grep mysql\r\nlibdbd-mysql-perl/now 4.028-2+b1 amd64 [installed,local]\r\nlibmysqlclient-dev/now 5.5.49-0+deb8u1 amd64 [installed,local]\r\nlibmysqlclient18/now 5.5.49-0+deb8u1 amd64 [installed,local]\r\nmysql-client/now 5.5.49-0+deb8u1 all [installed,local]\r\nmysql-client-5.5/now 5.5.49-0+deb8u1 amd64 [installed,local]\r\nmysql-common/now 5.5.49-0+deb8u1 all [installed,local]\r\n### たぶん別コンテナが必要なのだろう\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mediba-moritake/docker-rails/issues/comments/229022151","html_url":"https://github.com/mediba-moritake/docker-rails/issues/1#issuecomment-229022151","issue_url":"https://api.github.com/repos/mediba-moritake/docker-rails/issues/1","id":229022151,"user":{"login":"mediba-Kitada","id":5426530,"avatar_url":"https://avatars.githubusercontent.com/u/5426530?v=3","gravatar_id":"","url":"https://api.github.com/users/mediba-Kitada","html_url":"https://github.com/mediba-Kitada","followers_url":"https://api.github.com/users/mediba-Kitada/followers","following_url":"https://api.github.com/users/mediba-Kitada/following{/other_user}","gists_url":"https://api.github.com/users/mediba-Kitada/gists{/gist_id}","starred_url":"https://api.github.com/users/mediba-Kitada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mediba-Kitada/subscriptions","organizations_url":"https://api.github.com/users/mediba-Kitada/orgs","repos_url":"https://api.github.com/users/mediba-Kitada/repos","events_url":"https://api.github.com/users/mediba-Kitada/events{/privacy}","received_events_url":"https://api.github.com/users/mediba-Kitada/received_events","type":"User","site_admin":false},"created_at":"2016-06-28T11:23:57Z","updated_at":"2016-06-28T11:23:57Z","body":"@mediba-moritake \r\n\r\nディスカッションさせて頂き、ありがとうございました!\r\nMANTでの導入は、以下のPRでやっていきます 👍 \r\nhttps://github.com/mediba-system/Batman/pull/12"}}
{"actor":{"display_login":"mediba-Kitada"}}