php-fpm_exporter icon indicating copy to clipboard operation
php-fpm_exporter copied to clipboard

Add: build target to Makefile & builder to Dockerfile

Open cuppett opened this issue 2 years ago • 7 comments

Looking at this project and wanted to get started. Hoping these couple adds make it easier for newcomers to build the project, experiment or get more consistent container builds.

cuppett avatar Mar 19 '22 11:03 cuppett

Any chance we can get this merged?

donalddewulf avatar Mar 30 '22 09:03 donalddewulf

@cuppett Thanks for your submission. The only concern would be if this breaks the release process, but I can deal with this down the line. Always good to simplify things.

@donalddewulf Thanks for the nudge. Its being auto-merged once the GitHub action checks are done.

estahn avatar Mar 30 '22 09:03 estahn

@cuppett Apologies, there was an issue with the CI pipeline not testing the code correctly. I reverted your PR as it breaks the release and image scan actions.

estahn avatar Mar 30 '22 11:03 estahn

Sure. What was the issue/error? Anything you want me to resolve?

On Wed, Mar 30, 2022, 7:44 AM Enrico Stahn @.***> wrote:

@cuppett https://github.com/cuppett Apologies, there was an issue with the CI pipeline not testing the code correctly. I reverted your PR as it breaks the release and image scan actions.

— Reply to this email directly, view it on GitHub https://github.com/hipages/php-fpm_exporter/issues/214#issuecomment-1083036581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB2SIEV26OMEL4TLJZD7XTVCQ477ANCNFSM5RD5P5MA . You are receiving this because you were mentioned.Message ID: @.***>

cuppett avatar Mar 30 '22 21:03 cuppett

We're using goreleaser for the release process. The CI step uses goreleaser release --rm-dist --snapshot to build an image that can be checked for security vulnerabilities. This step fails with the following error message:

Step 2/17 : WORKDIR /workspace
 ---> Running in ca9433f8ba86
Removing intermediate container ca9433f8ba86
 ---> 3058893f804b
Step 3/17 : COPY go.mod go.mod
COPY failed: file not found in build context or excluded by .dockerignore: stat go.mod: file does not exist

see https://github.com/hipages/php-fpm_exporter/runs/5752709253?check_suite_focus=true

estahn avatar Mar 30 '22 21:03 estahn

Oh, I see what's going on. It already has the binaries built (outside the container) and likely removes the go.mod file. Definitely don't want to build it twice. I can leave the Dockerfile changes out of the PR and just have the tiny Makefile change or create a separate Dockerfile.build where the multi-stage build is to not conflict with the original one but still provide the benefit. Opinions?

cuppett avatar Mar 30 '22 23:03 cuppett

:tada: This issue has been resolved in version 2.1.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

github-actions[bot] avatar May 20 '22 07:05 github-actions[bot]