shantanuo
shantanuo

Reputation: 32296

Importing base image twice in the same dockerfile

Can I use aliases for base image? For e.g. is this valid in dockerfile?

FROM some_image AS builder

I can see the use of this like...

https://github.com/gliderlabs/registrator/blob/master/Dockerfile

But I will like to know if this is officially supported syntax.

Upvotes: 0

Views: 136

Answers (1)

Akash Sharma
Akash Sharma

Reputation: 757

Yes, its officially supported by docker and termed as multistage builder. It will help to reduce the docker image size considerably.

Upvotes: 1

Related Questions