Many of my OSS projects use complex setup: i need to customize environment (e.g. install PHP libraries) and install additional tools (i.e. Allure Framework, which, in turn, requires JVM, so i’m installing Jabba, Zulu@1.9.0 and Allure Framework). This happens on every build and bumps build time, pushing get-feedback-asap paradigm away. i think it is possible to allow users to define container setup - relatively static set of commands that define container content, result of which is committed as a new image and cached, skipping those steps on next build:
docker: - image: 'circleci/php:7.1' setup: - curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh - jabba install firstname.lastname@example.org - sudo docker-php-ext-install bcmath - echo 'memory_limit = -1' | sudo tee -a /usr/local/etc/php/php.ini - echo 'date.timezone = UTC' | sudo tee -a /usr/local/etc/php/php.ini
Those commands can easily eat away more than a minute of build time, which i would love to keep short. This, of course, would also require additional space for cached images, but they may be limited in numbers (e.g. only one such image per project - if setup section has changed between builds, discard old one and create new), also currently i’m doing quite the same using regular cache commands.