Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dockerfile - parameterized FROM

I want to include arguments in the FROM section. Is this possible? In the Dockerfile, I have:

ARG VERSION
FROM tomcat:$VERSION

I build as following:

docker build --build-arg VERSION=8.0 .

I get the following error:

Please provide a source image with `from` prior to commit

I am using docker version 1.12.6.

like image 618
Franz They Avatar asked Sep 17 '25 22:09

Franz They


1 Answers

Docker 1.9 has added support for build time arguments.

Reason for the error

like image 56
Pratheesh M Avatar answered Sep 20 '25 12:09

Pratheesh M