4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ubuntu 14.04でdockerを使って遊んでみる

Posted at

「えー、普通docker使って構築するでしょ なんでも」って言われて「また何でもブラックボックス化かぁ」と思ってるみゅみゅです。
サービスをdockerを使ってコンテナ化にしちゃって運用するのが普通だそうです。
(誰が決めた普通なのかは下っ端の私には聞けませんでした)
コンテナってSolaris8の時にSolarisコンテナで痛い目を見てるのでやだなぁと思いながらも、やらないで口だけで文句を言うのは嫌なので、Dockerを覚えます。

Dockerのインストール

色々なやり方があるかと思いますが、公式サイト通り進めていきたいと思います。

root@raidtest:~# uname -r
3.16.0-30-generic

※一応念のためバージョンの確認 3.10以上じゃないとダメだそうです

root@raidtest:~# sudo apt-get update
※ ずらずらずら~と・・・

root@raidtest:~# sudo apt-get install wget
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
wget は既に最新バージョンです。
アップグレード: 0 個、新規インストール: 0 個、削除: 0 個、保留: 111 個。

root@raidtest:~# wget -qO- https://get.docker.com/ | sh

・・・ずらずらずら~と そして最後

f you would like to use Docker as a non-root user, you should now consider
adding your user to the "docker" group with something like:

  sudo usermod -aG docker your-user

Remember that you will have to log out and back in for this to take effect!

root@raidtest:~#

※usermodはオプショナルだからまぁ いいかなぁ。。。

root@raidtest:~# sudo docker run hello-world

※確認だそうです

root@raidtest:~# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
hello-world         latest              91c95931e552        10 weeks ago        910 B

hello-world のイメージが入りました。

遊んでみる その1

kibanaを使いたい言われたので、kibanaのリポジトリーを入れてみます。
適当に探してみたら、
https://registry.hub.docker.com/u/devdb/kibana/
こんなのがありましたので書かれてる通り進めてみます。

root@raidtest:~# docker pull devdb/kibana:latest
latest: Pulling from devdb/kibana
(ここからずらずら~とダウンロードとか色々)

root@raidtest:~# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
devdb/kibana        latest              bf8cc6e7c506        5 weeks ago         884.7 MB
hello-world         latest              91c95931e552        10 weeks ago        910 B

※なんかイメージが入った!

root@raidtest:~# docker run -d --name kibana -p 5601:5601 -p 9200:9200 devdb/kibana
68df56f9fc85f53df2e5d5447a381575f5356e4c7afc7171bd1debe3ec550135

※特になんか怒られなかった!

この状態で、インストールしたマシンのIP:5601 にアクセスしたらkibanaの画面が出てきました。

うん、なんだろう。。。簡単ですね。。。。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?