Include Dockerfile from another Dockerfile

3,340 views
Skip to first unread message

Ted Yu

unread,
Apr 12, 2017, 12:12:50 PM4/12/17
to docker-dev
Hi,
I am currently working on creating Dockerfile which has steps to install Kerberos KDC packages.

There is already a Dockerfile for creating insecure VM.

Is there a way to include the insecure Dockerfile in the secure Dockerfile ?

I tried #include directive which seemed to be ignored.
Using include resulted in syntax error.

Here is the Docker version I am using:

Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017

Thanks for your hint.

Valentin Rothberg

unread,
Apr 15, 2017, 6:09:39 AM4/15/17
to Ted Yu, docker-dev
Hi Ted,

afaik there is no idiomatic way to do this. You can look up some pull
requests on github (e.g., https://github.com/docker/docker/pull/2337).
However, if you really want such composition, you can use the C
preprocessor (cpp) and then pipe the output to docker build or just
generate a new file.

Kind regards,
Valentin
> --
> You received this message because you are subscribed to the Google Groups
> "docker-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to docker-dev+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages