「仮想サーバ/docker」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→コンテナの削除) |
|||
行28: | 行28: | ||
NAME DESCRIPTION STARS OFFICIAL AUTOMATED | NAME DESCRIPTION STARS OFFICIAL AUTOMATED | ||
centos The official build of CentOS. 1911 [OK] | centos The official build of CentOS. 1911 [OK] | ||
+ | jdeathe/centos-ssh CentOS-6 6.7 x86_64 / SCL/EPEL/IUS Repos /... 15 [OK] | ||
+ | jdeathe/centos-ssh-apache-php CentOS-6 6.7 x86_64 / Apache / PHP / PHP M... 13 [OK] | ||
padster83/centos7-php7-laravel5 centos7 php7 and larvel5.1 4 [OK] | padster83/centos7-php7-laravel5 centos7 php7 and larvel5.1 4 [OK] | ||
− | ==dockerイメージ取得( | + | ==dockerイメージ取得(centos6.7)== |
dockerにログインしてから | dockerにログインしてから | ||
− | docker pull centos:latest | + | $ docker pull jdeathe/centos-ssh |
+ | Using default tag: latest | ||
+ | latest: Pulling from jdeathe/centos-ssh | ||
+ | a3ed95caeb02: Pull complete | ||
+ | 3b231ed5aa2f: Pull complete | ||
+ | 739732e8a1eb: Pull complete | ||
+ | 4748cf13cce1: Pull complete | ||
+ | b43cafb7f42b: Pull complete | ||
+ | ecc6934ef96a: Pull complete | ||
+ | d258b8324b77: Pull complete | ||
+ | 0bf7d359e07c: Pull complete | ||
+ | 34a742724dd4: Pull complete | ||
+ | 646a068632d8: Pull complete | ||
+ | a9397714f8e2: Pull complete | ||
+ | 4b0007b85fa0: Pull complete | ||
+ | 40cbdf152dd2: Pull complete | ||
+ | a9a0656572df: Pull complete | ||
+ | Status: Downloaded newer image for jdeathe/centos-ssh:latest | ||
==取得したイメージの確認== | ==取得したイメージの確認== | ||
行38: | 行57: | ||
REPOSITORY TAG IMAGE ID CREATED SIZE | REPOSITORY TAG IMAGE ID CREATED SIZE | ||
centos latest 61b442687d68 6 weeks ago 196.6 MB | centos latest 61b442687d68 6 weeks ago 196.6 MB | ||
+ | jdeathe/centos-ssh latest 09cc921e8147 6 days ago 253.3 MB | ||
+ | |||
+ | ==作成したコンテナの中に入る== | ||
+ | docker run -it jdeathe/centos-ssh:latest /bin/bash | ||
==コンテナの確認== | ==コンテナの確認== | ||
行46: | 行69: | ||
==コンテナの削除== | ==コンテナの削除== | ||
docker rm e831d68bfbe7 | docker rm e831d68bfbe7 | ||
− | |||
− | |||
− | |||
==その他== | ==その他== |
2016年2月16日 (火) 01:53時点における版
目次
macにdockerをインストール
Docker Toolboxをインストール https://www.docker.com/products/docker-toolbox (boot2dockerは非推奨らしい)
インストール確認
$ docker -v Docker version 1.10.0, build 590d5108 $ docker-machine -v docker-machine version 0.6.0, build e27fb87
コンテナ作成
defaultという名前でvmが起動する(virtualbox用)
docker-machine create --driver virtualbox default
vm一覧
$ docker-machine ls default * virtualbox Running tcp://192.168.99.100:2376 v1.10.0
起動
docker-machine start default
ログイン
docker-machine ssh default
docker検索
$ docker search centos NAME DESCRIPTION STARS OFFICIAL AUTOMATED centos The official build of CentOS. 1911 [OK] jdeathe/centos-ssh CentOS-6 6.7 x86_64 / SCL/EPEL/IUS Repos /... 15 [OK] jdeathe/centos-ssh-apache-php CentOS-6 6.7 x86_64 / Apache / PHP / PHP M... 13 [OK] padster83/centos7-php7-laravel5 centos7 php7 and larvel5.1 4 [OK]
dockerイメージ取得(centos6.7)
dockerにログインしてから
$ docker pull jdeathe/centos-ssh Using default tag: latest latest: Pulling from jdeathe/centos-ssh a3ed95caeb02: Pull complete 3b231ed5aa2f: Pull complete 739732e8a1eb: Pull complete 4748cf13cce1: Pull complete b43cafb7f42b: Pull complete ecc6934ef96a: Pull complete d258b8324b77: Pull complete 0bf7d359e07c: Pull complete 34a742724dd4: Pull complete 646a068632d8: Pull complete a9397714f8e2: Pull complete 4b0007b85fa0: Pull complete 40cbdf152dd2: Pull complete a9a0656572df: Pull complete Status: Downloaded newer image for jdeathe/centos-ssh:latest
取得したイメージの確認
docker images REPOSITORY TAG IMAGE ID CREATED SIZE centos latest 61b442687d68 6 weeks ago 196.6 MB jdeathe/centos-ssh latest 09cc921e8147 6 days ago 253.3 MB
作成したコンテナの中に入る
docker run -it jdeathe/centos-ssh:latest /bin/bash
コンテナの確認
$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e831d68bfbe7 centos:latest "/bin/bash" 20 minutes ago Exited (0) Less than a second ago drunk_ride
コンテナの削除
docker rm e831d68bfbe7
その他
docker-machine stop default # 停止 docker-machine rm default # 削除 docker-machine ip default # ip (192.168.99.100)
iso場所
/Users/user1/.docker/machine/machines/dev/boot2docker.iso