21/12/2021

[Docker] Include Dockerfile in another Dockerfile

Docker does not support including a Dockerfile in another Dockerfile, luckily the Dockerfile plus project comes to the rescue.

Simply setup your Dockerfile with:

# syntax = edrevo/dockerfile-plus:0.1.0

INCLUDE+ someDockerfile

FROM someimage

You might need to enable Docker buildkit in order to use this extension, simply set the environment variable:

DOCKER_BUILDKIT=1