Skip to content
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

Add smartmontools to container image #51

Merged
merged 1 commit into from
Aug 8, 2022
Merged

Conversation

SuperQ
Copy link
Contributor

@SuperQ SuperQ commented Aug 5, 2022

Switch to using Alpine container and install smartmontools so the
exporter can use the smartctl binary.

Signed-off-by: SuperQ [email protected]

Switch to using Alpine container and install smartmontools so the
exporter can use the smartctl binary.

Signed-off-by: SuperQ <[email protected]>
@kfox1111
Copy link

kfox1111 commented Aug 5, 2022

I'm thinking this will not work. Though I haven't tested it.

Alpine is made without glibc. I think the build, when done without CGO_ENABLED=0 fails to start properly in alpine due to the lack of shared library.

The released binaries though seem to be made with CGO_ENABLED=0 I think? They work for sure, as I've tested that combination https://github.com/pnnl-miscscripts/miscscripts/blob/master/containers/smartctl-exporter/Dockerfile

@SuperQ
Copy link
Contributor Author

SuperQ commented Aug 5, 2022

Prometheus builds are static, they do not use any libc.

@kfox1111
Copy link

kfox1111 commented Aug 5, 2022

Its been a while since I build statically linked binaries with go. is CGO_ENABLED=0 no longer required?

@SuperQ
Copy link
Contributor Author

SuperQ commented Aug 5, 2022

No, CGO_ENABLED=0 is the default. Static compile requires some build flags, which are part of the standard Prometheus Community build tooling.

@SuperQ SuperQ requested a review from sysadmind August 5, 2022 21:26
@SuperQ SuperQ merged commit b63f56e into master Aug 8, 2022
@SuperQ SuperQ deleted the superq/smartmontools branch August 8, 2022 13:44
SuperQ added a commit that referenced this pull request Oct 3, 2022
Breaking Changes:
All configuration has been moved from the config file to command line flags.

* [CHANGE] Refactor exporter config #68
* [BUGFIX] Fix smartctl command args to avoid wakeups #74
* [ENHANCEMENT] Add smartmontools to container image #51

Signed-off-by: SuperQ <[email protected]>
@SuperQ SuperQ mentioned this pull request Oct 3, 2022
SuperQ added a commit that referenced this pull request Oct 3, 2022
Breaking Changes:
All configuration has been moved from the config file to command line flags.

* [CHANGE] Refactor exporter config #68
* [BUGFIX] Fix smartctl command args to avoid wakeups #74
* [ENHANCEMENT] Add smartmontools to container image #51

Signed-off-by: SuperQ <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants