Skip to content

Instantly share code, notes, and snippets.

@gaaamii
Last active April 2, 2016 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaaamii/b13ab7c1c027c99e2e85 to your computer and use it in GitHub Desktop.
Save gaaamii/b13ab7c1c027c99e2e85 to your computer and use it in GitHub Desktop.

開発環境に関するメモ。

このメモの目的

  • 自分の開発環境を一定に保つ

なお、開発環境の要素をざっくり2つのパートに分ける。

  1. 仮想環境
  2. ミドルウェア

1. 仮想環境

仮想環境の構築にはDockerを利用する。

Dockerのインストール

Docker Toolbox を利用した。

Docker Toolbox について

You install Docker using Docker Toolbox. Docker Toolbox includes the following Docker tools:

  • Docker Machine for running the docker-machine binary
  • Docker Engine for running the docker binary
  • Docker Compose for running the docker-compose binary
  • Kitematic, the Docker GUI
  • a shell preconfigured for a Docker command-line environment
  • Oracle VM VirtualBox

Because the Docker daemon uses Linux-specific kernel features, you can’t run Docker natively in OS X. Instead, you must use docker-machine to create and attach to a virtual machine (VM). This machine is a Linux VM that hosts Docker for you on your Mac.

最後の一文だけ大事なので意訳 「DockerデーモンはLinuxカーネルの機能を利用するので、DockerをネイティブのOS X内で動かすことはできません。代わりに、docker-machineを使うことによって、VMを作成しそこに割り当てることができます。このマシンはMac上にDockerをホストするLinux VMです。」

Dockerを使う手順

  • Dockerfile を書く
  • docker build -t gaaamii/dev(任意のイメージ名) .(Dockerfileがあるパスを指定)

トラブルシューティング

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

以下を実行すればOK.

bash --login '/Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/start.sh'

OKじゃなかった...。なんでだ*

2. ミドルウェア

zsh

これを機にbashからzshへ乗り換える。

vim

設定・プラグインなどについて。

tmux

pry

node

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment