Filter::Dockerfile - Dockerfile preprocessor
$ perl -MFilter::Dockerfile Dockerfile.pre > Dockerfile # Dockerfile Syntax: INCLUDE ./Dockerfile.inc INCLUDE http://path/to/Dockerfile.inc INCLUDE ./Dockerfile.inc http://path/to/Dockerfile.inc INCLUDE MERGE a.inc b.inc # include only RUN instructions INCLUDE RUN a.inc b.inc # include only RUN and ENV instructions INCLUDE RUN ENV a.inc b.inc # include only RUN and ENV instructions but merge them INCLUDE MERGE RUN ENV a.inc b.inc # exclude FROM instructions INCLUDE -FROM a.inc b.inc
Filter::Dockerfile was written to allow simple pre-processing of Dockerfiles to add capabilities currently unsupported by docker build.
Filter::Dockerfile
This will inline a file or uri into the Dockerfile being generated.
When including multiple Dockerfile snippets this will attempt to merge common instructions. Currently only ENV, LABEL and RUN are merged, otherwise multiple instructions will be repeated. RUN instructions are merged with "&&" while other instructions are merged with a space.
Include or Exclude ADD instructions from inlined Dockerfile snippets
Include or Exclude CMD instructions from inlined Dockerfile snippets
Include or Exclude COPY instructions from inlined Dockerfile snippets
Include or Exclude ENTRYPOINT instructions from inlined Dockerfile snippets
Include or Exclude ENV instructions from inlined Dockerfile snippets
Include or Exclude EXPOSE instructions from inlined Dockerfile snippets
Include or Exclude FROM instructions from inlined Dockerfile snippets
Include or Exclude INCLUDE instructions from inlined Dockerfile snippets
Include or Exclude LABEL instructions from inlined Dockerfile snippets
Include or Exclude MAINTAINER instructions from inlined Dockerfile snippets
Include or Exclude ONBUILD instructions from inlined Dockerfile snippets
Include or Exclude RUN instructions from inlined Dockerfile snippets
Include or Exclude USER instructions from inlined Dockerfile snippets
Include or Exclude VOLUME instructions from inlined Dockerfile snippets
Include or Exclude WORKDIR instructions from inlined Dockerfile snippets
2015, Cory Bennett <cpan@corybennett.org>
The Source is available at github: https://github.com/coryb/perl-filter-dockerfile
Filter::Util::Call
Copyright (c) 2015 Netflix Inc. All rights reserved. The copyrights to the contents of this file are licensed under the Perl Artistic License (ver. 15 Aug 1997).
To install Filter::Dockerfile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Filter::Dockerfile
CPAN shell
perl -MCPAN -e shell install Filter::Dockerfile
For more information on module installation, please visit the detailed CPAN module installation guide.