In https://github.com/openshift/origin/pull/13178 we have introduced a new
experimental docker build strategy that avoids creating layers for each
statement in your dockerfile, which is a lot faster and gives you a single
layer in your image which avoids inefficient temporary copies of data. On
a five line dockerfile on devicemapper, it reduced build times by almost
60% (120s to 50s). Compared to overlay2, it reduced build times by 20-25%.
(50s to 40s). One downside is that layer caching is disabled, but if you
have a large build farm being able to reuse caches is rare.
You can try this out in master by adding a field to your build config's
dockerStrategy:
spec:
strategy:
dockerStrategy:
imageOptimizationPolicy: SkipLayers
As we get more feedback we'll add this as an option when defining a new
build on the CLI and UI
Since this is a new feature we have not granted access for normal users to
access it - use cluster-admin or grant access to create the
"builds/optimizeddocker" resource to a role (like you would enable docker
builds or pipeline builds)
This uses the https://github.com/openshift/imagebuilder library to
approximate the docker build using exec and other primitives like cp - be
aware that this library is slightly stricter than docker build command, but
also can't perform some operations related to file permissions on VOLUMEs
that are only possible via the Docker engine. We have tested on a wide
range of images, but it's always possible we find new issues.
Please give it a try and give feedback via issues in OpenShift. Thanks!
_______________________________________________
dev mailing list
[email protected]
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev