Cli: Include Keyword to use partial Dockerfiles

Created on 22 Jan 2019  路  1Comment  路  Source: docker/cli

Hi guys,

maybe I'm doing something wrong but I was really missing one feature.

As a programmer I always have the goal to work DRY. Unfortunately if I need a specific part of Dockerfile-code in multiple Dockerfiles, I have to copy it around.

It would be great if there wouldbe an INCLUDE keyword I could use in my Dockerfile.

Example:

FROM alpine:latest

COPY . /var/my-dir

INCLUDE ./Dockerfile.partial

[...]

And this partial Dockerfile contains regular Dockerfile code. My current workaround is loading a bash script which is not as nice as using Dockerfile syntax.

Best regards
Ron

arebuilder

Most helpful comment

+1 this would be a useful addition.

>All comments

+1 this would be a useful addition.

Was this page helpful?
0 / 5 - 0 ratings