Helping you build your Dockerfile and compile container without hurt.
- Some packages don't compile without hurt / unknown dependencies.
- I don't want to figure out why a build failed.
- I want a chef cook that gets the ingredients and serve me a working
Dockerfile!
This is what docker-recipe is for:
$ docker-recipe php/curl
# PHP cURL
RUN apt-get install -qqy libcurl4-openssl-dev
&& docker-php-ext-install curl
So cURL needs the libcurl4-openssl-dev to be compiled
and our Docker recipe brought that in.
Now it won't fail. Nice! 🎉
- Work on any OS!
- Be as silent as possible where it is okay (except for errors).
- Low number of intermediate container (using
&&in every recipe). - Clean up afterwards (like
apt purge -y some-package-dev).
Adding packages to a Dockerfile is easy as:
docker-recipe vcs >> Dockerfile
docker-recipe php/curl php/gd php/intl >> Dockerfile
We just added GIT, SVN, php-curl, php-gd and php-intl to the Dockerfile
with all dependencies.
The build should not fail but if so then let us know in the bug tracker.
You can also have a Dockerfile.recipe template:
FROM pretzlaw/php:7.2-apache
MAINTAINER John Doe <me@myself.i>
# @docker-recipe php/composer
RUN apt-get install -y git
# @docker-recipe wordpress
Running docker-recipe Dockerfile.recipe (or simply docker-recipe)
will parse this file and inject the recipes.
The commands:
docker-recipewrites theDockerfileusingDockerfile.recipeby default.docker-recipe some-other.drecipeparses another file flushing the result on STDOUT.docker-recipe parse some-other.drecipeparses a file (without recursion).docker-recipe find php/curlshows the path to the recipe.
Environment variables:
- Use
DOCKER_RECIPE_OS="debian"to switch concerns and maybe use other recipes. - Use
DOCKER_RECIPE_PATH="/some/other/recipesto fetch recipes from another directory. DOCKER_RECIPE_BASEpoints to the path of all commands and should not be overridden.
Other nice stuff:
- Each
.dffile is allowed to contain additional# @docker-recipereferences (recusively parse).