1Dockerコンテナを準備します
1.1DockerToolBoxをインストールします
参照:
http ://www.oschina.net/translate/installing-docker-on-mac-os-x
https://github.com/boot2docker/osx-installer/releases
1.2ubuntuミラーを構成する
$ docker pull daocloud.io/ubuntu:14.04
1.3 Dockerイメージを開始し、ubuntu14.04と入力します
$ docker run -it ubuntu:14.04
2Dockerコンテナへのインストール
2.1apt-getを更新する
#apt-更新を取得
2.2python2.7.6をインストールします
#sudo apt-get install python
2.3コマンドラインでファイルをダウンロードするツールであるwgetをインストールします
#apt-get install wget
2.4一時ディレクトリに入り、インストールに必要なファイルをダウンロードします
#cd tmp
2.5pipをダウンロードしてインストールする
#wget https://bootstrap.pypa.io/get-pip.py #python get-pip.py
—————-ベースエンド—————–
2.6makeのインストール
#apt-get install make
2.7 g ++をインストールする
#apt-get install build-depgcc #apt-get install build-essential
——— gcc end ————
2.8インストールの依存関係
#apt-get install libxml2-dev libxslt1-dev #apt-get install libgsl0-dev #apt-get install python-dev #apt-get install libffi-dev #apt-get install libssl-dev
——— dep end ————
2.9スクレイプをインストールする
#pipインストールscrapy
3変更を保存する方法
3.1dockerTerminalを終了します
#出口
3.2containerIdの表示
$ docker ps -a -q cc4072aadb13
3.3画像を保存する
$ docker commit cc40 ubuntu / spider 02db509cb269710f8f80b2a35f12995c59c668b3e3ba2e7148987bc55d713fa5
3.4保存したばかりの画像を表示する
$ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu / spider latest138b6860da02約1分前 228.2MBubuntu最新6cc0fc2a5ee33日前187.9MB ubuntu 14.046cc0fc2a5ee33日前187.9MB honeydeiMac:〜caojianfeng $
3.5次のコマンドを使用して、以前にインストールした環境に入ることができます
$ docker run -it ubuntu / spider