Commit Graph

9 Commits

Author SHA1 Message Date
c7b68277d5
fix: rename application 2023-07-09 12:57:07 +02:00
2434615258
feat: multi-stage build for container image
Adapt the Makefile and Dockerfile for a multi-stage build of the
container image. It is now not anymore required to have go locally
installed to build the container image.

Inside the multi-stage build, the newly create make install command will
be executed. The compbiled files will than be copied to a new base image
with less dependencies.

Further improvement would be to use instead of debian:10 scratch,
because the application does not have any C dependencies
(CGO_ENABLED=0).

Additionally it is not possible to build the container image with
alternative container runtimes like podman instead of docker.

make build/container-image CONTAINER_RUNTIME=podman

The used base image names are now defined as fully qualified image names
(with registry host), to support local container registry mirror
configurations.
2023-07-07 14:42:42 +02:00
Hector
772cdb52c5 chore: rewrite dockerfile
Rewrite the Dockerfile to be ready for fully automating releases using GoReleaser.
2023-06-19 19:06:18 +00:00
Hector
3911eca07e feat: rename output binary and archives
Update the goreleaser config to rename the output binary and archive names
to `fail2ban_exporter` instead of defaulting to the project name. This
better aligns with conventions used by other exporters.
Update Dockerfile and Makefile to follow the new naming scheme.
Update the output archives to wrap the build files in a folder. This makes
extracting the archives a little easier.

BREAKING CHANGE: Release binary name has been changed to `fail2ban_exporter`.
2022-02-20 08:46:40 +00:00
Hector
f6e328a0aa feat: correctly handle shutdown signals
Add a new method to the application startup to listen for OS shutdown
signals and handle them appropriately. A shutdown signal will cause the
app to exit immediately.
Use correct syntax for the `ENTRYPOINT` field in the Dockerfile to ensure
that OS signals get passed down to the running application.
2022-02-20 08:17:06 +00:00
Hector
0f0efe58af feat: remove startup script from docker image
Update the docker image to remove the `run.sh` script and instead run the
exporter directly. This keeps the docker image as simple as possible.
Update README file with extra info on how to collect textfile metrics in
a docker container.

BREAKING CHANGE: Using the textfile collector in docker now requires setting environment variables.
2022-02-19 14:10:36 +00:00
Hector
3c4a8f5495 build: split docker build into two images (#9)
Update the docker build file to use two images - one for building, and one
for running/deployment. This helps reduce the size of the final image.
2021-03-27 17:29:28 +00:00
Hector
b63f641bfd build: compile tool during docker build
Update the project Dockerfile to compile the tool during the docker build
instead of assuming the goreleaser tool was run previously. This allows
for custom data to be set in the compiled tool (e.g. compiled by docker)
and removes the dependency on another build step.
Update the Makefile to include a new command to build the tool for docker
which sets the version data correctly. Rename the docker commands to follow
the `docker/build-...` format to avoid confusion with the build commands.
2021-02-08 19:48:55 +00:00
Hector
9dc8dd862f build: add project dockerfile (#2)
Add a project Dockerfile to allow deploying the application in a docker
container. Add a `run.sh` script to start the application in the container.
Add Makefile commands to build the docker image based on the Dockerfile.
Fix possible nil reference error in the `db` package.
2021-02-07 13:09:02 +00:00