在使用开源Dockerfile构建镜像时,dockerfile的From以前经过ARG定义版本,指定基础镜像,以下:git
ARG VERSION=lasted FROM alpine:${VERSION}
执行docker build
报错以下:github
Please provide a source image with `from` prior to commit
容许这种用法是在docker 17.05.0-ce (2017-05-04)
以后才引入的,查看本机版本为17.03.2-ce
,因此报错很正常了,能够参见docker
Allow using build-time args (ARG) in FROM #31352