New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerize #832
Dockerize #832
Conversation
Thanks for the work on this. Can you tell me more about why we would want this in Perl::Critic? What are the benefits of running Perl::Critic out of a container? |
I've fixed the typo in |
I use this in my build pipelines. As part of our ci/cd piplines all supporting tools are wrapped in docker so that any ci/cd activity can be run locally or in the cloud without having to worry about doing installs on the build servers or dev pc's and be confident of the same outcomes. We have an approach we call The 3 Musketeers - https://amaysim.engineering/the-3-musketeers-how-make-docker-and-compose-enable-us-to-release-many-times-a-day-e92ca816ef17 , which uses Make, Docker and Docker-Compose to perform all our build and deploy activities. As I wanted to use Perl-Critic to ensure some standards on our perl scripts, I needed to put it in docker, so I thought I would share my Dockerfile with you. For me, i can call On a side note, all our build instances are in the cloud and are scaled on demand, so it is convenient for us to have all pipeline/build tooling in docker so that we don't have to keep maintaining an Uber build image that contains every possible tool across many languages and versions. I have setup a public auto build on my docker file, from our forked repo, so that my version is available as a public docker image: https://hub.docker.com/r/amaysim/perl-critic/ . This docker image is only 14MBs and is 100 % self contained including the perl runtime and all pre-req Perl Modules. So anyone can use the image "amaysim/perl-critic". I thought it would take very little effort for you to re-use the docker file and then you could release your own Official version of the docker image. Once setup dockerhub will auto regenerate the docker image every time you commit/merge to master or a specific branch. If you like, I can show examples of how I am using this docker image in my ci/cd pipeline. Regards |
What you just wrote up sounds like a blog post waiting to happen. I'm OK with putting the Dockerfile in the |
Sounds great. hoping it will be helpful to others. |
We've been moving to Docker for MetaCPAN. Maybe @ssoriche would want to check this PR? |
Sorry, just realized I never commented on this request. It looks good to me, and could be really helpful. |
I think it would be great to have this, especially if @isaac-gittins can provide examples about how he uses the Docker image in his pipeline. |
Done. Thank you. See c9f4d5f |
Overview
Creates a Docker Image which contains all the required perl libs, and executes
./bin/perlcritic
by default.Build Docker Image:
docker build -t image:label .
Use the image
The docker image will execute the
./bin/perlcritic
script, and arguments to thedocker run
command will be passed to theperlcritic
Invoke
docker run image:label [perlcritic options]
How I use it
I follow the The Three Musketeers method and as part of my CI/CD Pipelines, I:
make
target todocker-compose
to runperlcritic
discovers issues.