Docker入門
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
#contents
** 概要 [#f45b9b1a]
- Docker とはなにか?
-- 軽量な仮想化環境
-- Build once, run anywhere
-- 公式サイト: https://www.docker.com
- 環境
-- Ubuntu (Vagrant) <- Docker
-- OS X 10.11 El Capitan
-- Vagrant 1.9.7
-- VirtualBox 5.1.26
-- Docker for Mac (Version 17.06.1-ce-mac24)
** Ubuntu ローカル環境構築 [#xe27c862]
- Ubuntu 14.04 (64bit) の box を追加
$ vagrant box add trusty64 https://cloud-images.ubuntu.c...
- Vagrant 用ディレクトリ作成
$ mkdir Docker
$ cd Docker
- Vagrant の初期化
$ vagrant init trusty64
- ネットワークアダプター設定
$ vi Vagrantfile
--------------------
config.vm.network "private_network", ip: "192.168.55.44"
--------------------
- Vagrant 起動
$ vagrant up
- SSH 接続確認
$ vagrant ssh
** Dockerインストール [#f97e9d85]
- [[インストールガイド (Docker CE for Ubuntu):https://doc...
- apt-get update
$ sudo apt-get update
- 推奨パッケージインストール
$ sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
- 必要パッケージインストール
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
- Docker 公式 GPG キー追加
$ curl -fsSL https://download.docker.com/linux/ubuntu/gp...
- GPG キーのフィンガープリント確認
$ sudo apt-key fingerprint 0EBFCD88
/etc/apt/trusted.gpg
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8...
uid Docker Release (CE deb) <docker@doc...
sub 4096R/F273FCD8 2017-02-22
- Dcoker 公式リポジトリ追加
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/u...
$(lsb_release -cs) \
stable"
- 依存パッケージインストール
$ sudo apt-get update
- Docker CE インストール
$ sudo apt-get install docker-ce
- Docker CE バージョン確認
$ sudo docker --version
Docker version 17.06.1-ce, build 874a737
- インストール確認
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6...
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be ...
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image fro...
3. The Docker daemon created a new container from that ...
executable that produces the output you are currentl...
4. The Docker daemon streamed that output to the Docker...
to your terminal.
To try something more ambitious, you can run an Ubuntu c...
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free D...
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
** Docker コマンドと基本コンポーネント [#f5510293]
- Docker installed OS ... Docker がインストールされた OS
- Image ... "docker pull" で OS 上に取得
- Container .... "docker pull" で取得した Image を "docke...
- Image ... Container 上で "docker commit" を実行して再度...
- Docker Hub
-- 旧 Docker Index
-- Docker が運営する Image の管理サイト
- URL: https://hub.docker.com
-- "docker commit" で作成した Image を "docker push" で D...
** Image を操作 [#hdee39e6]
- Docker Hub 上の Image を "docker search" で CLI でも検...
$ sudo docker search centos | more
- Docker Hub から "docker pull" で centos の Image を取得
$ sudo docker pull centos
- Image 一覧を表示 &color(red){※}; IMAGE ID が Image の実...
$ sudo docker images
REPOSITORY TAG IMAGE ID ...
centos latest 328edcd84f1b ...
hello-world latest 1815c82652c0 ...
- Image の詳細表示 (REPOSITORY:TAG 指定) &color(red){※}; ...
$ sudo docker inspect centos:latest
- Image の詳細表示 (IMAGE ID を前方一致で指定)
$ sudo docker inspect 328ed
- Image の削除
$ sudo docker rmi 328ed
** Container を操作してみよう [#qb3e39c6]
- Container 起動
$ sudo docker run centos echo "hello world"
- 実行中のコンテナ一覧
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND ...
354a27ea31e1 centos "echo 'hello wor...
450df998fddf centos "echo 'hello wor...
eef1eb757c2e hello-world "/hello" ...
- 実行中のコンテナ一覧 (最後に実行した5つの Container を...
$ sudo docker ps -a -n=5
- コンテナ削除 (CONTAINER ID を前方一致で指定)
$ sudo docker rm eef
$ sudo docker ps -a
** 実行中の Container を操作 [#i40db5c3]
- centos 上でバックラグラウドで free コマンドを実行
$ sudo docker run -d centos free -s 3
1fb08aae68483f2253ed8cb84f329b48d95edaba5e99ac490dab4c86...
$ sudo docker ps
CONTAINER ID IMAGE COMMAND ...
1fb08aae6848 centos "free -s 3" ...
- ログ確認
$ sudo docker logs 1fb
- 実行中タスクをフォアグラウンドに表示 (Ctrl + c で抜ける)
$ sudo docker attach --sig-proxy=false 1fb
- 実行中タスクを停止
$ sudo docker kill 1fb
- 停止タスクを再開
$ sudo docker start 1fb
** Container から Image を作成 [#ucaa13c6]
- Container にログイン (インタラクティブモードで docker r...
$ sudo docker run -i -t centos /bin/bash
- hello.txt を追加
[root@24b42c9b3ac1 /]# touch hello.txt
[root@24b42c9b3ac1 /]# exit
- Container 確認
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND ...
24b42c9b3ac1 centos "/bin/bash" ...
- Image 作成 (CONTAINER ID の次に Image の名前指定)
$ sudo docker commit 24b yuji/hello
- Image 確認
$ sudo docker images
REPOSITORY TAG IM...
yuji/hello latest b3...
- 作成した Image から Container を起動
$ sudo docker run -i -t yuji/hello /bin/bash
# ls hello.txt
hello.txt
** Dockerfile の利用 [#he596158]
- "docker build" コマンドで Image -> Container 起動 -> Im...
- Dockerifle に処理を記述
$ vi Dockerfile
$ cat Dockerfile
FROM centos
MAINTAINER Yuji Shimojo <y.shimojo@example.com>
# RUN: build する時に実行
RUN echo "now building..."
# CMD: run する時に実行
# CMD echo "now running..."
CMD ["echo", "now running..."]
- Dcoker ビルド
$ sudo docker build -t yuji/echo .
- Container 起動確認
$ sudo docker run yuji/echo
now running...
** Web サーバー起動 [#ub6d5a10]
- Dockerfile 編集 (CentOS 6 のイメージを利用)
$ vi Dockerfile
FROM imagine10255/centos6-lnmp-php56
MAINTAINER Yuji Shimojo <y.shimojo@example.com>
RUN yum install -y httpd
ADD ./index.html /var/www/html/
EXPOSE 80
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
- index.html 作成
$ vi index.html
<html>
helllo from Docker!
</html>
- Docker ビルド
$ sudo docker build -t yujishimojo/httpd .
- Docker 起動 (サーバー側の tcp/80 を Container 側の tcp/...
$ sudo docker run -p 8080:80 -d yujishimojo/httpd
- ブラウザ経由で http://192.168.55.44:8080/ へアクセスし...
** Image をプッシュ [#y85a56b5]
- Docker Hub アカウント作成
- ターミナルからログイン
$ sudo docker login
Username:
Password:
- Image を push &color(red){※}; Docker Hub アカウントの u...
$ sudo docker push yujishimojo/httpd
- Docker Hub 上で Image が push されていることを確認
- docker pull することで他環境にも同じ Image を配布するこ...
** Docker for Mac [#u548a7bf]
- [[Download:https://www.docker.com/docker-mac]]
- [[Get started with Docker for Mac:https://docs.docker.c...
*** Amazon Linux Image [#t07afafd]
- Image の検索
$ docker search amazonlinux | more
- Image の取得
$ docker pull amazonlinux
- Image 一覧表示
$ docker images
REPOSITORY TAG IMAGE ID ...
amazonlinux latest 766ebb052d4f ...
- Container にインタラクティブモードでログイン
$ docker run -i -t amazonlinux /bin/bash
- OS バージョン確認
# cat /etc/system-release
Amazon Linux AMI release 2017.03
- Yum リポジトリ一覧表示 (enabled のみ抜粋)
# sudo yum repolist all
repo id repo name status
amzn-main/latest amzn-main-Base enable...
amzn-updates/latest amzn-updates-Base ...
- yum update
# yum -y update
- 時刻表示
# date
Mon Aug 28 03:39:31 UTC 2017
- SELinux ステータス確認 &color(red){※}; Amazon Linux で...
# getenforce
bash: getenforce: command not found
- iptables ステータス確認 &color(red){※}; Amazon Linux で...
# etc/init.d/iptables status
bash: etc/init.d/iptables: No such file or directory
*** Heroku Ruby Image [#w9817621]
- Image の検索
$ docker search heroku | more
- Image の取得
$ docker pull heroku/ruby
- Image 一覧表示
$ docker images
REPOSITORY TAG IMAGE ID ...
heroku/ruby latest dc7ebd538ae6 ...
- Container にインタラクティブモードでログイン
$ docker run -i -t heroku/ruby /bin/bash
- OS バージョン確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
- git バージョン確認
# git --version
git version 1.9.1
- ruby / gem バージョン確認 &color(red){※}; rbenv / rails...
# ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
# gem --version
2.4.5.1
- Gem 構成確認
# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5.1
- RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86...
- INSTALLATION DIRECTORY: /app/heroku/ruby/bundle/ruby...
- RUBY EXECUTABLE: /app/heroku/ruby/ruby-2.2.3/bin/ruby
- EXECUTABLE DIRECTORY: /app/heroku/ruby/bundle/ruby/2...
- SPEC CACHE DIRECTORY: /root/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /app/vendor/ruby-2.2...
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /app/heroku/ruby/bundle/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /app/user/bin
- /app/heroku/ruby/bundle/ruby/2.2.0/bin
- /app/heroku/ruby/node-0.12.7/bin
- /app/heroku/ruby/ruby-2.2.3/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- PostgreSQL バージョン確認
# psql --version
psql (PostgreSQL) 9.5.5
- Node.js バージョン確認
# node -v
v0.12.7
- Python バージョン確認
# python --version
Python 2.7.6
- Java バージョン確認
# java -version
java version "1.7.0_121"
OpenJDK Runtime Environment (IcedTea 2.6.8) (7u121-2.6.8...
OpenJDK 64-Bit Server VM (build 24.121-b00, mixed mode)
- &color(red){※}; php はインストールされていない
*** Heroku Cedar Image [#u988507d]
- Image の検索
$ docker search heroku | more
- Image の取得
$ docker pull heroku/cedar
- Image 一覧表示
$ docker images
REPOSITORY TAG IMAGE ID ...
heroku/cedar latest cfcf6ab6adde ...
- Container にインタラクティブモードでログイン
$ docker run -i -t heroku/cedar /bin/bash
- OS バージョン確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
- git バージョン確認
# git --version
git version 1.9.1
- ruby / gem バージョン確認 &color(red){※}; rbenv / rails...
# ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
# gem --version
1.8.23
- Gem 構成確認
# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86...
- INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.9.1
- /root/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
- PostgreSQL バージョン確認
# psql --version
psql (PostgreSQL) 9.6.4
- Python バージョン確認
# python --version
Python 2.7.6
- Java バージョン確認
# java -version
java version "1.7.0_131"
OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9...
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)
- &color(red){※}; node.js / php はインストールされていない
*** Google Images [#d7eb180b]
$ docker search google | more
NAME DESCRIPTI...
google/cadvisor Analyzes ...
google/cloud-sdk Google Cl...
google/golang ...
google/nodejs-runtime ...
google/nodejs ...
google/debian ...
google/golang-runtime ...
google/python Please us...
google/docker-registry Docker Re...
google/python-runtime Please us...
google/mysql MySQL ser...
google/nodejs-hello ...
google/golang-hello ...
google/ruby ...
google/pause ...
google/ruby-hello ...
google/guestbook-python-redis A simple ...
終了行:
#contents
** 概要 [#f45b9b1a]
- Docker とはなにか?
-- 軽量な仮想化環境
-- Build once, run anywhere
-- 公式サイト: https://www.docker.com
- 環境
-- Ubuntu (Vagrant) <- Docker
-- OS X 10.11 El Capitan
-- Vagrant 1.9.7
-- VirtualBox 5.1.26
-- Docker for Mac (Version 17.06.1-ce-mac24)
** Ubuntu ローカル環境構築 [#xe27c862]
- Ubuntu 14.04 (64bit) の box を追加
$ vagrant box add trusty64 https://cloud-images.ubuntu.c...
- Vagrant 用ディレクトリ作成
$ mkdir Docker
$ cd Docker
- Vagrant の初期化
$ vagrant init trusty64
- ネットワークアダプター設定
$ vi Vagrantfile
--------------------
config.vm.network "private_network", ip: "192.168.55.44"
--------------------
- Vagrant 起動
$ vagrant up
- SSH 接続確認
$ vagrant ssh
** Dockerインストール [#f97e9d85]
- [[インストールガイド (Docker CE for Ubuntu):https://doc...
- apt-get update
$ sudo apt-get update
- 推奨パッケージインストール
$ sudo apt-get install \
linux-image-extra-$(uname -r) \
linux-image-extra-virtual
- 必要パッケージインストール
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
- Docker 公式 GPG キー追加
$ curl -fsSL https://download.docker.com/linux/ubuntu/gp...
- GPG キーのフィンガープリント確認
$ sudo apt-key fingerprint 0EBFCD88
/etc/apt/trusted.gpg
pub 4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8...
uid Docker Release (CE deb) <docker@doc...
sub 4096R/F273FCD8 2017-02-22
- Dcoker 公式リポジトリ追加
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/u...
$(lsb_release -cs) \
stable"
- 依存パッケージインストール
$ sudo apt-get update
- Docker CE インストール
$ sudo apt-get install docker-ce
- Docker CE バージョン確認
$ sudo docker --version
Docker version 17.06.1-ce, build 874a737
- インストール確認
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
b04784fba78d: Pull complete
Digest: sha256:f3b3b28a45160805bb16542c9531888519430e9e6...
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be ...
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image fro...
3. The Docker daemon created a new container from that ...
executable that produces the output you are currentl...
4. The Docker daemon streamed that output to the Docker...
to your terminal.
To try something more ambitious, you can run an Ubuntu c...
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free D...
https://cloud.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
** Docker コマンドと基本コンポーネント [#f5510293]
- Docker installed OS ... Docker がインストールされた OS
- Image ... "docker pull" で OS 上に取得
- Container .... "docker pull" で取得した Image を "docke...
- Image ... Container 上で "docker commit" を実行して再度...
- Docker Hub
-- 旧 Docker Index
-- Docker が運営する Image の管理サイト
- URL: https://hub.docker.com
-- "docker commit" で作成した Image を "docker push" で D...
** Image を操作 [#hdee39e6]
- Docker Hub 上の Image を "docker search" で CLI でも検...
$ sudo docker search centos | more
- Docker Hub から "docker pull" で centos の Image を取得
$ sudo docker pull centos
- Image 一覧を表示 &color(red){※}; IMAGE ID が Image の実...
$ sudo docker images
REPOSITORY TAG IMAGE ID ...
centos latest 328edcd84f1b ...
hello-world latest 1815c82652c0 ...
- Image の詳細表示 (REPOSITORY:TAG 指定) &color(red){※}; ...
$ sudo docker inspect centos:latest
- Image の詳細表示 (IMAGE ID を前方一致で指定)
$ sudo docker inspect 328ed
- Image の削除
$ sudo docker rmi 328ed
** Container を操作してみよう [#qb3e39c6]
- Container 起動
$ sudo docker run centos echo "hello world"
- 実行中のコンテナ一覧
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND ...
354a27ea31e1 centos "echo 'hello wor...
450df998fddf centos "echo 'hello wor...
eef1eb757c2e hello-world "/hello" ...
- 実行中のコンテナ一覧 (最後に実行した5つの Container を...
$ sudo docker ps -a -n=5
- コンテナ削除 (CONTAINER ID を前方一致で指定)
$ sudo docker rm eef
$ sudo docker ps -a
** 実行中の Container を操作 [#i40db5c3]
- centos 上でバックラグラウドで free コマンドを実行
$ sudo docker run -d centos free -s 3
1fb08aae68483f2253ed8cb84f329b48d95edaba5e99ac490dab4c86...
$ sudo docker ps
CONTAINER ID IMAGE COMMAND ...
1fb08aae6848 centos "free -s 3" ...
- ログ確認
$ sudo docker logs 1fb
- 実行中タスクをフォアグラウンドに表示 (Ctrl + c で抜ける)
$ sudo docker attach --sig-proxy=false 1fb
- 実行中タスクを停止
$ sudo docker kill 1fb
- 停止タスクを再開
$ sudo docker start 1fb
** Container から Image を作成 [#ucaa13c6]
- Container にログイン (インタラクティブモードで docker r...
$ sudo docker run -i -t centos /bin/bash
- hello.txt を追加
[root@24b42c9b3ac1 /]# touch hello.txt
[root@24b42c9b3ac1 /]# exit
- Container 確認
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND ...
24b42c9b3ac1 centos "/bin/bash" ...
- Image 作成 (CONTAINER ID の次に Image の名前指定)
$ sudo docker commit 24b yuji/hello
- Image 確認
$ sudo docker images
REPOSITORY TAG IM...
yuji/hello latest b3...
- 作成した Image から Container を起動
$ sudo docker run -i -t yuji/hello /bin/bash
# ls hello.txt
hello.txt
** Dockerfile の利用 [#he596158]
- "docker build" コマンドで Image -> Container 起動 -> Im...
- Dockerifle に処理を記述
$ vi Dockerfile
$ cat Dockerfile
FROM centos
MAINTAINER Yuji Shimojo <y.shimojo@example.com>
# RUN: build する時に実行
RUN echo "now building..."
# CMD: run する時に実行
# CMD echo "now running..."
CMD ["echo", "now running..."]
- Dcoker ビルド
$ sudo docker build -t yuji/echo .
- Container 起動確認
$ sudo docker run yuji/echo
now running...
** Web サーバー起動 [#ub6d5a10]
- Dockerfile 編集 (CentOS 6 のイメージを利用)
$ vi Dockerfile
FROM imagine10255/centos6-lnmp-php56
MAINTAINER Yuji Shimojo <y.shimojo@example.com>
RUN yum install -y httpd
ADD ./index.html /var/www/html/
EXPOSE 80
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
- index.html 作成
$ vi index.html
<html>
helllo from Docker!
</html>
- Docker ビルド
$ sudo docker build -t yujishimojo/httpd .
- Docker 起動 (サーバー側の tcp/80 を Container 側の tcp/...
$ sudo docker run -p 8080:80 -d yujishimojo/httpd
- ブラウザ経由で http://192.168.55.44:8080/ へアクセスし...
** Image をプッシュ [#y85a56b5]
- Docker Hub アカウント作成
- ターミナルからログイン
$ sudo docker login
Username:
Password:
- Image を push &color(red){※}; Docker Hub アカウントの u...
$ sudo docker push yujishimojo/httpd
- Docker Hub 上で Image が push されていることを確認
- docker pull することで他環境にも同じ Image を配布するこ...
** Docker for Mac [#u548a7bf]
- [[Download:https://www.docker.com/docker-mac]]
- [[Get started with Docker for Mac:https://docs.docker.c...
*** Amazon Linux Image [#t07afafd]
- Image の検索
$ docker search amazonlinux | more
- Image の取得
$ docker pull amazonlinux
- Image 一覧表示
$ docker images
REPOSITORY TAG IMAGE ID ...
amazonlinux latest 766ebb052d4f ...
- Container にインタラクティブモードでログイン
$ docker run -i -t amazonlinux /bin/bash
- OS バージョン確認
# cat /etc/system-release
Amazon Linux AMI release 2017.03
- Yum リポジトリ一覧表示 (enabled のみ抜粋)
# sudo yum repolist all
repo id repo name status
amzn-main/latest amzn-main-Base enable...
amzn-updates/latest amzn-updates-Base ...
- yum update
# yum -y update
- 時刻表示
# date
Mon Aug 28 03:39:31 UTC 2017
- SELinux ステータス確認 &color(red){※}; Amazon Linux で...
# getenforce
bash: getenforce: command not found
- iptables ステータス確認 &color(red){※}; Amazon Linux で...
# etc/init.d/iptables status
bash: etc/init.d/iptables: No such file or directory
*** Heroku Ruby Image [#w9817621]
- Image の検索
$ docker search heroku | more
- Image の取得
$ docker pull heroku/ruby
- Image 一覧表示
$ docker images
REPOSITORY TAG IMAGE ID ...
heroku/ruby latest dc7ebd538ae6 ...
- Container にインタラクティブモードでログイン
$ docker run -i -t heroku/ruby /bin/bash
- OS バージョン確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
- git バージョン確認
# git --version
git version 1.9.1
- ruby / gem バージョン確認 &color(red){※}; rbenv / rails...
# ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
# gem --version
2.4.5.1
- Gem 構成確認
# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5.1
- RUBY VERSION: 2.2.3 (2015-08-18 patchlevel 173) [x86...
- INSTALLATION DIRECTORY: /app/heroku/ruby/bundle/ruby...
- RUBY EXECUTABLE: /app/heroku/ruby/ruby-2.2.3/bin/ruby
- EXECUTABLE DIRECTORY: /app/heroku/ruby/bundle/ruby/2...
- SPEC CACHE DIRECTORY: /root/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /app/vendor/ruby-2.2...
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /app/heroku/ruby/bundle/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /app/user/bin
- /app/heroku/ruby/bundle/ruby/2.2.0/bin
- /app/heroku/ruby/node-0.12.7/bin
- /app/heroku/ruby/ruby-2.2.3/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- PostgreSQL バージョン確認
# psql --version
psql (PostgreSQL) 9.5.5
- Node.js バージョン確認
# node -v
v0.12.7
- Python バージョン確認
# python --version
Python 2.7.6
- Java バージョン確認
# java -version
java version "1.7.0_121"
OpenJDK Runtime Environment (IcedTea 2.6.8) (7u121-2.6.8...
OpenJDK 64-Bit Server VM (build 24.121-b00, mixed mode)
- &color(red){※}; php はインストールされていない
*** Heroku Cedar Image [#u988507d]
- Image の検索
$ docker search heroku | more
- Image の取得
$ docker pull heroku/cedar
- Image 一覧表示
$ docker images
REPOSITORY TAG IMAGE ID ...
heroku/cedar latest cfcf6ab6adde ...
- Container にインタラクティブモードでログイン
$ docker run -i -t heroku/cedar /bin/bash
- OS バージョン確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"
- git バージョン確認
# git --version
git version 1.9.1
- ruby / gem バージョン確認 &color(red){※}; rbenv / rails...
# ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
# gem --version
1.8.23
- Gem 構成確認
# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.23
- RUBY VERSION: 1.9.3 (2013-11-22 patchlevel 484) [x86...
- INSTALLATION DIRECTORY: /var/lib/gems/1.9.1
- RUBY EXECUTABLE: /usr/bin/ruby1.9.1
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/1.9.1
- /root/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
- PostgreSQL バージョン確認
# psql --version
psql (PostgreSQL) 9.6.4
- Python バージョン確認
# python --version
Python 2.7.6
- Java バージョン確認
# java -version
java version "1.7.0_131"
OpenJDK Runtime Environment (IcedTea 2.6.9) (7u131-2.6.9...
OpenJDK 64-Bit Server VM (build 24.131-b00, mixed mode)
- &color(red){※}; node.js / php はインストールされていない
*** Google Images [#d7eb180b]
$ docker search google | more
NAME DESCRIPTI...
google/cadvisor Analyzes ...
google/cloud-sdk Google Cl...
google/golang ...
google/nodejs-runtime ...
google/nodejs ...
google/debian ...
google/golang-runtime ...
google/python Please us...
google/docker-registry Docker Re...
google/python-runtime Please us...
google/mysql MySQL ser...
google/nodejs-hello ...
google/golang-hello ...
google/ruby ...
google/pause ...
google/ruby-hello ...
google/guestbook-python-redis A simple ...
ページ名: