This is a Drone plugin to build a lot of Docker images.
PLUGIN_REGISTRY: Registry to upload the image to. (required)PLUGIN_DEFAULT_NAMESPACE: Namespace to use if not specified indocker-matrix.yml(default:images).PLUGIN_BUILD_POOL_SIZE: Number of parallel Docker builds (default:4).PLUGIN_UPLOAD_POOL_SIZE: Number of parallel Docker uploads (default:4).PLUGIN_TAG_NAME: Tag Name (default:latest).PLUGIN_TAG_BUILD_ID: Build id, generatestagandtag-b<build_id>for each tag; skipped if empty (default empty).PLUGIN_SKIP_UPLOAD: Skip upload to registries, useful for testing (defaultfalse)
NOTE: For values in PLUGIN_TAG_NAME and PLUGIN_TAG_ID one may choose to use environment variables. Substition is handled by drone/envsubst
The subdirectories are the image names.
puppet
puppet/Dockerfile
puppet/Gemfile
python
python/Dockerfile
php/
php/docker-matrix.yml
php/Dockerfile
[...]
The puppet and the python image are build as they are. The php image will get the special matrix treatment.
multiplyoptions will get multiplied with each other (optional).appendoptions are just added as they are (optional).namespacecan overwrite theDEFAULT_NAMESPACEvariable (optional).additional_namescan supply additional image-names to upload to, i.e. to other registries (optional).
NOTE: For values in multiply, append, and namespace one may choose to use environment variables. Substition is handled by drone/envsubst
# docker-matrix.yml
multiply:
VERSION:
- 7.2
- 7.3
OS:
- alpine
- debian
append:
- { NAME: test, LANG: ${LANG} }
namespace: images
additional_names:
- docker.io/bitsbeats/image1
- docker.io/bitsbeats/image2The Dockerfile has to contain the argument names and default values. Example:
ARG \
VERSION=7.3 \
OS=debian \
NAME=test
FROM php:$VERSION-fpm-$OS
RUN touch $NAMEExample:
export PLUGIN_WORKDIR=/home/user42/docker-images
export PLUGIN_REGISTRY=registry.example.com
export PLUGIN_DEFAULT_NAMESPACE=images
drone-docker-matrix