顯示具有 docker 標籤的文章。 顯示所有文章
顯示具有 docker 標籤的文章。 顯示所有文章

2017/07/01

Bitnami 的預設安裝 VM 及容器服務

https://bitnami.com/   是一個提供預先安裝基礎建設及應用程式的服務網站,可以讓開發人員「初期」不用花太多心思再基礎建設上面,就可以用預先安裝好的服務。

所以先選你要的機器影像檔 VM
https://bitnami.com/stack/nginx/virtual-machine

因為我用的是 Linux KVM 但上面只提供 .OVA 格式,所以需要轉換一下格式。
https://wiki.hackzine.org/sysadmin/kvm-import-ova.html  KVM: Importing an OVA appliance

然後就是設定 KVM 的 Machine 了!!
(略)

設定好後,把 SSH 打開最重要的。
https://docs.bitnami.com/virtual-machine/faq/

至於服務該如何使用,可以參考他的文件說明

其他的操作,就和一般使用 Linux 是一樣的。很快速的你就可以有一個可靠的開發環境了。

最後,bitnami 會自動回傳統計資訊回他的網站,記得把他關閉。


2015/03/10

使用現成的 docker images ,以 mtchang/lamp 為例

就練習 docker 的過程,我用很笨的方式做了一個 docker images 以 LAMP 服務為例,底下為這個的說明:

1. 使用這個 docker images
# 從 docker hub 抓取這個版本的 lamp
sudo docker pull mtchang/lamp
# 看看本地端的 images 是否抓好了
sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
mtchang/lamp        latest              59480b898c91        7 minutes ago       578.1 MB
...(skip)...
# 以 mtchang/lamp 的 images 啟動一個 container ,動作是本地端的 tcp 8080:對應到 container 中的 tcp 80 port
# 將本地端指定的目錄 對應到 伺服器端目錄 ,並且啟動 /usr/bin/supervisord 讓 container 可以停在系統內
# sudo docker run -d -p 8080:80 -v 本地端目錄:伺服器端目錄 mtchang/lamp /usr/bin/supervisord
# example:
sudo docker run -d -p 8080:80 -v /home/mtchang/app:/var/www/html/test mtchang/lamp /usr/bin/supervisord
# 觀看是否常駐
sudo docker ps
CONTAINER ID        IMAGE                 COMMAND                CREATED              STATUS              PORTS                  NAMES
0b65d5ceae03        mtchang/lamp:latest   "/usr/bin/supervisor   About a minute ago   Up About a minute   0.0.0.0:8080->80/tcp   jolly_brattain      
2. LAMP 功能測試:
(1) http://:8080/
LAMP server
https://registry.hub.docker.com/u/mtchang/lamp/
by mtchang.tw@gmail.com
(2) http://:8080/test/
會出現對應到本地端目錄 /home/mtchang/app 目錄的內容
(3)phpmyadmin http://192.168.123.59:8080/phpmyadmin/
mysql root password is "dockermysql"
(4)sqlbuddy http://192.168.123.59:8080/sqlbuddy
3. 結束這個 container 的程式
# 使用 docker attach 進入 container 的 console 使用 ctrl + c 中斷程式。
docker attach 0b65d5ceae03
^C2015-03-07 15:33:10,571 WARN received SIGINT indicating exit request

透過用 dockerfile 配置可以快速生成 docker image 並實現 container 部署


透過用 dockerfile 配置可以快速生成 docker image 並實現 container 部署

範例:
官方說明文件:


(1) 本機 dockerfile 建立
# 在本地端的目錄下,建立一個檔案名稱為 Dockerfile
#
# FROM:你的 base image 為基底
# MAINTAINER:維護 images 的人
# RUN:在 images 建立過程執行的指令
# ADD:將本機的檔案或遠端的檔案加入到 image 內的目錄
mtchang@mt ~/SCM_code/docker/apdemo $ vim Dockerfile
FROM ubuntu:latest
MAINTAINER mtchang
# Install packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
  apt-get -y install supervisor git apache2 libapache2-mod-php5 mysql-server php5-mysql pwgen php-apc php5-mcrypt && \
  echo "ServerName localhost" >> /etc/apache2/apache2.conf
#Enviornment variables to configure php
ENV PHP_UPLOAD_MAX_FILESIZE 10M
ENV PHP_POST_MAX_SIZE 10M
# 執行 docker build 會直接依據 dockerfile 內容編譯 image
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker build -t mtchang/apdemo   .  (點)
# 注意每個過程都會有各 hash code
Sending build context to Docker daemon  2.56 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:latest
 ---> 5ba9dab47459
Step 1 : MAINTAINER mtchang
 ---> Running in 584aa4bb3e1c
 ---> 6c304964c942
Removing intermediate container 584aa4bb3e1c
Step 2 : ENV DEBIAN_FRONTEND noninteractive
 ---> Running in 9522aec6d092
 ---> 4eb8188f88d7
Removing intermediate container 9522aec6d092
Step 3 : RUN apt-get update &&   apt-get -y install supervisor git apache2 libapache2-mod-php5 mysql-server php5-mysql pwgen php-apc php5-mcrypt &&   echo "ServerName localhost" >> /etc/apache2/apache2.conf
 ---> Running in b7c3e263758c
...(省略數百行)...
Removing intermediate container cd49243be07b
Step 6 : EXPOSE 8080
 ---> Running in a4843a5a0c8e
 ---> c31129378fe8
Removing intermediate container a4843a5a0c8e
Successfully built c31129378fe8
# 第二次編譯速度會比較快,因為使用了 cache
mtchang@mt ~/SCM_code/docker/apdemo $ vim Dockerfile
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker build -t mtchang/apdemo .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:latest
 ---> 5ba9dab47459
Step 1 : MAINTAINER mtchang
 ---> Using cache
 ---> 6c304964c942
Step 2 : ENV DEBIAN_FRONTEND noninteractive
 ---> Using cache
 ---> 4eb8188f88d7
Step 3 : RUN apt-get update &&   apt-get -y install supervisor git apache2 libapache2-mod-php5 mysql-server php5-mysql pwgen php-apc php5-mcrypt &&   echo "ServerName localhost" >> /etc/apache2/apache2.conf
 ---> Using cache
 ---> b0d088b36fe3
Step 4 : ENV PHP_UPLOAD_MAX_FILESIZE 10M
 ---> Using cache
 ---> 61e966ed8a2d
Step 5 : ENV PHP_POST_MAX_SIZE 10M
 ---> Using cache
 ---> 431d2a1cc310
Successfully built 431d2a1cc310
# 建立的影像檔案 mtchang/apdemo
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
mtchang/apdemo      latest              431d2a1cc310        14 minutes ago      426 MB
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker login
Username (mtchang):
Login Succeeded
# 可以單獨將這個檔案 push 到 docker hub 上面
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker push mtchang/apdemo
The push refers to a repository [mtchang/apdemo] (len: 1)
Sending image list
Pushing repository mtchang/apdemo (1 tags)
511136ea3c5a: Image already pushed, skipping
27d47432a69b: Image already pushed, skipping
5f92234dcf1e: Image already pushed, skipping
51a9c7c1f8bb: Image already pushed, skipping
5ba9dab47459: Image already pushed, skipping
6c304964c942: Image already pushed, skipping
4eb8188f88d7: Image already pushed, skipping
b0d088b36fe3: Image already pushed, skipping
61e966ed8a2d: Image already pushed, skipping
431d2a1cc310: Image already pushed, skipping
Pushing tag for rev [431d2a1cc310] on {https://cdn-registry-1.docker.io/v1/repositories/mtchang/apdemo/tags/latest}
# 以上為依據 dockerfile 的建立方法,但是產生的檔案只有本機可以使用。 push 到 docker hub 仍是影像檔案型態,使用者看不到你的 dockerfile 。

(2) 配合 github 的 dockerfile 建立
Docker hub 可以從 github 的儲存庫中,依據 Dockerfile 的內容自動建立影像檔案。
所以請先在 github 中建立一個 Dockerfile 檔案, README 有則是最好。



在 Docker HUB 內建立一個 REPOS 選擇 Github 的儲存庫。


在 docker hub 內選擇 automated Build 選項。


把 Active 打勾,並確認路徑是否正確。


按下 save and trigger build 就會自動建立 dockerfile 檔案了。



(3) 使用及測試
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker pull mtchang/apdemo
Pulling repository mtchang/apdemo
d0611a67283c: Download complete
d0611a67283c: Pulling image (latest) from mtchang/apdemo
fa4fd76b09ce: Download complete
1c8294cc5160: Download complete
117ee323aaa9: Download complete
2d24f826cb16: Download complete
d5f32e0f2638: Download complete
f6b232724428: Download complete
a392b7a15278: Download complete
ad48e990d540: Download complete
Status: Downloaded newer image for mtchang/apdemo:latest
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
mtchang/apdemo      latest              d0611a67283c        17 minutes ago      425.9 MB
mtchang@mt ~/SCM_code/docker/apdemo $ sudo docker run -i -t -p 8080:80 mtchang/apdemo/bin/bash
root@c88dac59dbab:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:08  
          inet addr:172.17.0.8  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:acff:fe11:8/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:648 (648.0 B)  TX bytes:648 (648.0 B)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
root@c88dac59dbab:/# /etc/init.d/apache2 restart
 * Restarting web server apache2

# Docker HOST 上面看到的 iptables 狀況
mt ~ # iptables -L -n -t nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination        
DOCKER     all  --  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        
DOCKER     all  --  0.0.0.0/0           !127.0.0.0/8          ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination        
MASQUERADE  all  --  172.17.0.0/16        0.0.0.0/0          
MASQUERADE  tcp  --  172.17.0.8           172.17.0.8           tcp dpt:80
Chain DOCKER (2 references)
target     prot opt source               destination        
DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:8080 to:172.17.0.8:80

# 測試網頁
http://:8080/





2015/03/09

docker 應用情境案例(2):把這個 container 提交並且上傳到 docker hub

# 把系統中最後狀態的 container commit ,並且上傳 docker hub 提供分享。
# 先使用 docker ps -a 觀看 container ID
mtchang@mt ~ $ sudo docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                      PORTS               NAMES
…(skip) ...
b29f95d30b68        ubuntu:14.04        "/bin/bash"         20 hours ago        Exited (0) 17 minutes ago  
# 使用 docker commit  提交 -m 為提交的說明 -a 為作者資訊
#  b29f95d30b68 為提交的 container ID
#  mtchang/lamp 為 REPOSITORY[:TAG]  ,在本機提交後顯示成為 docker images 的 REPOSITORY 及 TAG ,並且產生一個新的 hash code
mtchang@mt ~ $ sudo docker commit -m="jangmt/lamp v1" -a="mtchang" b29f95d30b68 mtchang/lamp
cfa9495f5d8f62278ff235a6124309b81aff48afdec74adb625d118a39b36cbf
# 檢查看看提交後的 docker images
mtchang@mt ~ $ sudo docker images 
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
mtchang/lamp        latest              cfa9495f5d8f        29 seconds ago      248.9 MB
Docker HUB 提交 push
# 版本更新,在提交一次。
docker commit -m="jangmt/lamp v4" -a="mtchang" 0b65d5ceae03 mtchang/lamp
59480b898c911ed8551eb18c24bf35992d2561714be15c0919f9c5a15008290d
# 登入 docker hub ,先確定你在 docker hub 已經有帳號了
mtchang@mt ~ $ sudo docker login
Username: mtchang
Password: oooxxx
Email: mtchang.tw@gmail.com
Login Succeeded
# 檢查一下最後要提交的 images
mtchang@mt ~ $ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
mtchang/lamp        latest              cfa9495f5d8f        43 minutes ago      248.9 MB
# docker push 提交 mtchang/lamp ,系統會檢查 hash code 如果影像檔有提交過了,會跳過不重複提交。基本上影像檔都是由很多小的影像檔組合成的。
mtchang@mt ~ $ sudo docker push mtchang/lamp
The push refers to a repository [mtchang/lamp] (len: 1)
Sending image list
Pushing repository mtchang/lamp (1 tags)
511136ea3c5a: Image already pushed, skipping
27d47432a69b: Image already pushed, skipping
5f92234dcf1e: Image already pushed, skipping
51a9c7c1f8bb: Image already pushed, skipping
5ba9dab47459: Image already pushed, skipping
cfa9495f5d8f: Image successfully pushed
Pushing tag for rev [cfa9495f5d8f] on {https://cdn-registry-1.docker.io/v1/repositories/mtchang/lamp/tags/latest}

Docker 實作與應用講義

Docker 實作與應用講義



講義文字說明版:
https://docs.google.com/document/d/1sR11ZLgYToPp68fGM4dVhUaUKf4M-OKjL0KIXTbWf5Y/pub

講義圖片來源均來自網路上,詳細來源有寫在文字版內。

有關於 Docker 的安裝

Docker 的運作是在 Linux kernel 的基礎上,在非 Linux 的平台如 Windows 他是透過 輕量級的 VM 元件產生一個虛擬機器在系統上執行,這個元件叫做 Boot2Docker (https://docs.docker.com/installation/windows/),所以跑起來和 Linux 不太一樣。所以在 MAC OS X 上面的 Docker 用的 Boot2Docker(https://docs.docker.com/installation/mac/ ) 也是用類似的方式達成的。


我不建議在非 Linux 平台上面使用 Docker ,使用一個完整的 Linux 來使用 Docker 才是較為正確的方式。

目前在 ubuntu 及 centos 可以用的的維護套件名稱為 docker.io ,ubuntu 由 http://www.ubuntuupdates.org/ppa/docker 這裡在維護提供。 

Centos 7的 Docker 從 RHEL7 重新編譯,目前收錄在 CentOS-Extras 套件庫中( http://wiki.centos.org/zh-tw/Cloud/Docker )。
如果可以建議你使用 ubuntu 最新的14.04 LTS 版本
Linux  mint 對應 Ubuntu 14.04 的版本為 Linux Mint 17.1 Rebecca
使用 CnetOS 7 最新的版本來安裝
如果你不是用這些新的版本的 Linux,請你參考 docker 官方網站的說明來解決你安裝上的問題。


延伸閱讀:

2015/03/08

docker 應用情境案例(1):一個 Apache2 + PHP 服務安裝為例

# 啟動一個以 ubuntu image為主 的 container , 名稱命名為 jangmt0305 ,並將本地端的 tcp port 8080 對應到 container  80 ,並且 -i 將 STDIN 保留, -t 取得一個虛擬終端機,並執行 /bin/bash  的程序。
mtchang@mt ~ $ sudo docker run --name="jangmt0305" -p 8080:80 -i -t ubuntu /bin/bash
# 底下為在 docker container 內的 /bin/bash 執行
root@b29f95d30b68:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:09  
          inet addr:172.17.0.9  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:acff:fe11:9/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:508 (508.0 B)  TX bytes:508 (508.0 B)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
# docker host 另開一個新視窗,從外部來看目前的 container 執行狀況
mtchang@mt ~ $ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                  NAMES
b29f95d30b68        ubuntu:14.04        "/bin/bash"         36 seconds ago      Up 35 seconds       0.0.0.0:8080->80/tcp   jangmt0305
# 可以透過 Linux 的 iptables 看到系統開了一個 DNAT 對應  tcp dpt:8080 to:172.17.0.9:80
mtchang@mt ~ $ sudo iptables -L -n -t nat
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination        
DOCKER     all  --  0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        
Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination        
DOCKER     all  --  0.0.0.0/0           !127.0.0.0/8          ADDRTYPE match dst-type LOCAL
Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination        
MASQUERADE  all  --  172.17.0.0/16        0.0.0.0/0          
MASQUERADE  tcp  --  172.17.0.9           172.17.0.9           tcp dpt:80
Chain DOCKER (2 references)
target     prot opt source               destination        
DNAT       tcp  --  0.0.0.0/0            0.0.0.0/0            tcp dpt:8080 to:172.17.0.9:80
# 回到 docker container 內,可以執行安裝程序。
root@b29f95d30b68:/# apt-get install apache2 php5-cli  libapache2-mod-php5
# 啟動服務
root@b29f95d30b68:/# /etc/init.d/apache2 restart
 * Restarting web server apache2                                                                                                                                AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.9. Set the 'ServerName' directive globally to suppress this message          [ OK ]
root@b29f95d30b68:/# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp6       0      0 :::80                   :::*                    LISTEN      -              
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
# 用瀏覽器測試看看觀看網址  http://:8080/
# 把剛剛的 container 重新載入啟動,需要記住 container ID 號碼,可以使用 docker ps -a 來查詢。
mtchang@mt ~ $ sudo docker start b29f95d30b68
b29f95d30b68
mtchang@mt ~ $ sudo docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                  NAMES
b29f95d30b68        ubuntu:14.04        "/bin/bash"         19 minutes ago      Up 6 seconds        0.0.0.0:8080->80/tcp   jangmt0305
# 可以透過 docker attach 取回 container ,重新取得 /bin/bash
mtchang@mt ~ $ sudo docker attach b29f95d30b68
root@b29f95d30b68:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:0a  
          inet addr:172.17.0.10  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:acff:fe11:a/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:648 (648.0 B)  TX bytes:648 (648.0 B)
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

2015/02/12

Linux Mint 17 OR Ubuntu 的 Docker 服務安裝

# Linux mint 安裝 docker
mtchang@mt ~ $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 17 Qiana
Release: 17
Codename: qiana
# ubuntu 因為安裝過程很煩,所以它把安裝過程寫成了script 放在 https://get.docker.com/ubuntu/ ,所以底下的安裝需要先透過 curl 抓回 script ,然後透過 shell 執行安裝。
mtchang@mt ~ $ sudo apt-get install curl
# 它需要有 apparmor ,這是一個應用程式安全性的控管機制
mtchang@mt ~ $ sudo apt-get install apparmor
# 安裝由 ubuntu 維護的 docker.io 套件,不要安裝原本 ubuntu 提供的 docker 套件
mtchang@mt ~ $ sudo apt-get install docker.io
# 載入 bash 環境變數
mtchang@mt ~ $ source /etc/bash_completion.d/docker.io
# 抓取安裝 script 並執行
mtchang@mt ~ $ curl -sSL https://get.docker.com/ubuntu/ | sudo sh
# 直接執行 ubuntu 的影像檔
mtchang@mt ~ $ sudo docker run -i -t ubuntu /bin/bash
# 第一次執行會發現還沒有 ubuntu 這個影像檔,會直接從網路上抓取
Unable to find image 'ubuntu' locally
Pulling repository ubuntu
5ba9dab47459: Download complete
511136ea3c5a: Download complete
27d47432a69b: Download complete
5f92234dcf1e: Download complete
51a9c7c1f8bb: Download complete
# 然後就直接進入 container
root@6bcf5474cbf3:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:ac:11:00:02
          inet addr:172.17.0.2  Bcast:0.0.0.0  Mask:255.255.0.0
          inet6 addr: fe80::42:acff:fe11:2/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:43 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7262 (7.2 KB)  TX bytes:648 (648.0 B)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
root@6bcf5474cbf3:/# df -lh
Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                  451G   28G  401G   7% /
none                                                    451G   28G  401G   7% /
tmpfs                                                   1.9G     0  1.9G   0% /dev
shm                                                      64M     0   64M   0% /dev/shm
/dev/disk/by-uuid/600e3388-c76f-4b56-ba18-14b58274f430  451G   28G  401G   7% /etc/hosts
tmpfs                                                   1.9G     0  1.9G   0% /proc/kcore
root@6bcf5474cbf3:/# exit
exit
mtchang@mt ~ $ sudo docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
ubuntu              trusty              5ba9dab47459        13 days ago         188.3 MB
ubuntu              14.04               5ba9dab47459        13 days ago         188.3 MB
ubuntu              14.04.1             5ba9dab47459        13 days ago         188.3 MB
ubuntu              latest              5ba9dab47459        13 days ago         188.3 MB