FROM

指定所创建镜像的基础镜像。格式为FROM <image> [AS <name>]FROM <image>:<tag> [AS <name>]FROM <image>@<digest> [AS <name>]

任何Dockerfile中第一条指令必须为FROM指令。并且,如果在同一个Dockerfile中创建多个镜像时,可以使用多个FROM指令(每个镜像一次)。

为了保证镜像精简,可以选用体积较小的镜像如Alpine或Debian作为基础镜像。

Last updated