

## 1. Image是什么?

* 查看當前機器有哪些docker鏡像。
```
[root@VM_0_11_centos ~]# docker image ls
```
> 會有一個hello-word image
```
[root@VM_0_11_centos ~]# docker run hello-world
```
## 2.獲取Image(1)
* 這個方法屬于自力更生,自己制作。

* 創建一個c語言文件hello.c

* 安裝gcc和glibc-static
```
yum install gcc glibc-static
```
* hello.c 輸出一個可執行文件hello
```
[root@VM_0_11_centos docker-test]# gcc -static hello.c -o hello
```
* 新建Dockerfile文件

> 上圖scratch拼錯了
* 構建
> 注意要先登陸docker
```
docker login
```
```
[root@VM_0_11_centos docker-test]# docker build -t bizzbee/test .
```

* 運行!
```
[root@VM_0_11_centos docker-test]# docker run bizzbee/test
hello docke
```
## 3.獲取Image(2)
* 相當于從倉庫拉取現成的。

* 可以從dockerhub網站查詢可用的image。
[docker-hub](https://hub.docker.com/search?q=java&type=image)

* 使用docker pull 加上image名字進行拉取。