This repo holds the collections of "ready-to-use" code snippets helping to develop tiny Docker images.
Collection | Description |
---|---|
Make Recipes | Certain "ready to use" Makefile recipes to cover the most of Docker image development:
|
Make Functions | Makefile functions for common Docker development tasks: build, test via Dgoss, and uuid generation. |
Bash Scripts | POSIX-compliant shell scripts for Alpine Linux to short-cut the commonly used Dockerfile RUN directives:
|
Configs | Config for Hadolint tool (see .hadolint.yaml). |
Just copy the sources to your project root. Or you can add it as submodule to your repository via command below:
git submodule add https://github.com/piotr-semenov/dockerfile-commons dockerfile-commons
- Docker and Docker-Compose
- CLI tools: GNU make, curl
- Goss and Dgoss
You can setup the following environment variables in your .env file.
Variable | Description | Used by recipes |
---|---|---|
HADOLINT_CONFIG | Path to your Hadolint config (if not set, make lint-dockerfiles will use "./dockerfile-commons/.hadolint.yaml"). |
lint-dockerfiles |
IMAGE_NAMES | Whitespace-separated list of Docker image tags existing in your local Docker registry. E.g. "postgres:9 ubuntu:latest". | scan-docker |
Please, find the example .env file below:
HADOLINT_CONFIG=$$PWD/.hadolint.yaml
IMAGE_NAMES=postgres:9 busybox
Now you do the job via make lint-dockerfiles test-dockerignore scan-docker clean-docker
.
Also you can include these recipes in your own Makefile with lines below:
include /path/to/dockerfile-commons/Makefile
Projects using dockerfile-commons
Project | Description |
---|---|
tiny-elm | The smallest docker image for recent Elm compiler + tools. |
tiny-yuicompressor | The smallest docker image for yuicompressor tool. |
tiny-uglify | The smallest docker image for uglifyJS and uglifyCSS tools. |
tiny-parigp | The smallest docker image for PARI/GP and GP2C scientific software. |