buffet: Assembles many Dockerfiles in one.

[ development, library, mit, program ] [ Propose Tags ]

See https://github.com/evolutics/buffet

[Skip to Readme]
Versions [faq] 0.2.0, 0.3.0
Dependencies base (>=4.7 && <5), buffet-internal [details]
License MIT
Copyright 2019 Benjamin Fischer
Author Benjamin Fischer
Maintainer benjamin.fischer@evolutics.info
Category Development
Home page https://github.com/evolutics/buffet#readme
Bug tracker https://github.com/evolutics/buffet/issues
Source repo head: git clone https://github.com/evolutics/buffet
Uploaded by evolutics at Mon Dec 2 22:04:28 UTC 2019
Distributions NixOS:0.3.0
Executables buffet
Downloads 105 total (44 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user [build log]
All reported builds failed as of 2019-12-03 [all 1 reports]


Maintainer's Corner

For package maintainers and hackage trustees

Readme for buffet-0.3.0

[back to package description]

Buffet 🍜

Build License Package

Assemble many Dockerfiles in a single Dockerfile. This gives you the convenience of one Docker image with your favorite tools while keeping the modularity of a separate Dockerfile per tool.

See Code Cleaner Buffet for an application of this.



stack install buffet


cabal install buffet

You are ready when

buffet --help


Usage example

Say we work on a simple website with HTML code that we would like to format, clean up, and validate. For this purpose, we choose the tools Prettier and HTML Tidy, which we plan use in continuous integration via a Docker image.

For the following, we assume you first run

git clone https://github.com/evolutics/buffet.git
cd buffet


In the subfolders of examples/quick_start, you see a Dockerfile for Prettier and another Dockerfile for HTML Tidy. These Dockerfiles (called "dishes") are the modular toy blocks, which we now automatically combine to one Dockerfile (called "buffet") by running

buffet assemble examples/quick_start

This prints a Dockerfile based on the subfolders of examples/quick_start. From this, we can then build a Docker image mona_linta with

buffet assemble examples/quick_start | \
  docker build --build-arg prettier=1.19.1 --tag mona_linta -

Note how in case of Prettier, we pass a --build-arg to parameterize the tool version.


As a demo that our Docker image works as expected, run

docker run -it --rm mona_linta
prettier --version
tidy --version

To integrate a check like prettier --version as a test of the tool installation, add a HEALTHCHECK instruction as you see in the Dockerfile for Prettier. The exit status of such a command is then reported when you run our example test suite with

buffet test --arguments examples/quick_start/test_arguments.yaml \

This builds a Docker image to then run the tests. The file test_arguments.yaml provides a map that is used for two things: firstly, its entries are used as --build-arg options when building the image, and secondly, only tests of dishes referred in this map are run.

If you like, try adding a test for HTML Tidy.


You can generate documentation with

buffet document --template examples/quick_start/document_template.md.mustache \

This renders the template document_template.md.mustache. To print the raw template context, omit this option as in

buffet document examples/quick_start

Among others, data from LABEL instructions is integrated in the template context.


  • Buffet: A Dockerfile automatically assembled based on many dishes.
  • Dish: A Dockerfile, usually providing a specific command-line tool.
  • Menu: Configuration with a list of dishes to be assembled in a buffet.