
---
## WTF is Docker ???

----
Docker
---
## 為什麼要用Docker
----
比起一般的虛擬化,使用 Docker 有許多優勢
----
## 一般的VM v.s. Docker

----
## 比較

---
## install
```bash=
$ curl -sSL https://get.docker.com/ubuntu/ | sudo sh
```
---
## images(映像)
例如:一個映像檔可以包含一個完整的 ubuntu 作業系統環境,裡面僅安裝了使用者需要的其它應用程式。
---
## container(容器)
容器是從映像檔建立的執行實例。它可以被啟動、開始、停止、刪除。每個容器都是相互隔離的平台。
---
## registry(倉庫)
### Docker Hub => [link](https://hub.docker.com/)

---
## docker pull(取得映像檔)
```bash
$ docker pull bcbcarl/hollywood
```

----
## docker images(列出)
```bash
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
isg latest e13fd8a649e8 3 days ago 3.68GB
mcr.microsoft.com/devcontainers/base jammy 46ddc7dc0a15 3 months ago 661MB
fathyb/carbonyl latest 173e471b5251 9 months ago 274MB
bcbcarl/hollywood latest 8a85ac985999 5 years ago 533MB
```
---
## dockerfile
----
FROM
```dockerfile
FROM <image>
FROM <image>:<tag>
```
example:
```dockerfile
FROM ubuntu
```

----
RUN
```dockerfile
RUN <command>
RUN ["executable", "<param1>", "<param2>"]
```
example:
```dockerfile
RUN apt update\
&& apt upgrade
```
----
ENV
```dockerfile
ENV <key> <value>
```
example
```dockerfile
```
{"title":"Docker","description":"explain what is Docker","contributors":"[{\"id\":\"e0c7dab8-be31-4e15-a8e7-22968131e3e1\",\"add\":2727,\"del\":958}]"}