hipages/php-fpm_exporter

Add: build target to Makefile & builder to Dockerfile

cuppett opened this issue ยท 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.

Any chance we can get this merged?

@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.

@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.

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

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?

๐ŸŽ‰ This issue has been resolved in version 2.1.0 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€