Updated Dockerfile and circleci configuration to build dependencies into a new bmo-slim image based on Perl 5.30
Categories
(bugzilla.mozilla.org :: Infrastructure, enhancement)
Tracking
()
People
(Reporter: dkl, Assigned: dkl)
Details
Attachments
(1 file)
Currently we use a separate repo mozilla-bteam/bmo-systems for building slim images tha contain only the Perl dependency related software and no actual BMO code. When we want to add a new Perl module, etc. we add it that repo, and circleci creates a new mozillabteam/bmo-slim image on Docker Hub. Since Docker now supports multi-stage builds we can add the dependency building part to the first stage of the Dockerfile. The second stage will then copy in only the Perl modules themselves and then add the BMO code and other things needed for a fully working BMO image. This allows the final image to still be as small as possible.
Along with the Dockerfile changes, the circleci config needed to updated to build the new image each time as part of the workflow. And then the tests are ran against the new image that was built earlier.
| Assignee | ||
Comment 1•6 years ago
|
||
| Assignee | ||
Comment 2•6 years ago
|
||
Plan has changed a bit due to issues with CircleCI account and docker layer caching. The caching was important for this in order to get around using an intermediate docker image in the deployment process. Once the Circle CI problems have been solved we can revisit this in a new bug that brings back the single image deployment plan.
For now, I have made the following changes in order to get this landed:
- Instead of replying on building the intermediate image from a separate bmo-systems github repo, I have created a Dockerfile.bmo-slim file that lives in the standard BMO repo. The new Dockerfile.bmo-slim uses the same perl-5.30 base image instead of Centos6 as we do currently.
- I have updated the README.rst to describe the process for building a new bmo-sim docker image and pushing it to hub.docker.com. This can happen outside of normal deployments by someone with admin access to the Dockerhub registry.
- I have updated the CircleCI config to use the new bmo-slim image before performing the automated test and then the final build and push of the completed bmo image.
So whenever we change any dependency requirements in the Makefile.PL or extensions, we will need to first generate the new cpanfile and cpanfile.snapshot, commit those to the repo, and then use the Dockerfile.bmo-slim to generate a new bmo-slim image and push to Dockerhub.
dkl
| Assignee | ||
Comment 3•6 years ago
|
||
Merged to master.
Description
•