-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# syntax=docker/dockerfile:experimental | ||
|
||
# Use the Alpine Linux 3 base image | ||
FROM docker.io/alpine:3.20.0 | ||
|
||
# Define build arguments | ||
ARG VERSION | ||
ARG TARGETPLATFORM | ||
ARG TARGETARCH | ||
ARG TARGETOS | ||
|
||
# Set the maintainer label | ||
LABEL xyz.glants.image.target_platform=$TARGETPLATFORM | ||
LABEL xyz.glants.image.target_architecture=$TARGETARCH | ||
LABEL xyz.glants.image.target_os=$TARGETOS | ||
LABEL org.opencontainers.image.title="smartctl-exporter" | ||
LABEL org.opencontainers.image.source="https://github.com/prometheus-community/smartctl_exporter" | ||
LABEL maintainer="The Prometheus Authors <prometheus-developers@googlegroups.com>" | ||
|
||
# Install required packages | ||
RUN apk add --no-cache smartmontools wget | ||
|
||
# Download and extract the smartctl_exporter binary | ||
RUN wget -O /tmp/smartctl_exporter.tar.gz https://github.com/prometheus-community/smartctl_exporter/releases/download/v${VERSION}/smartctl_exporter-${VERSION}.${TARGETOS}-${TARGETARCH}.tar.gz \ | ||
&& tar -xzf /tmp/smartctl_exporter.tar.gz -C /tmp \ | ||
&& mv /tmp/smartctl_exporter-${VERSION}.${TARGETOS}-${TARGETARCH}/smartctl_exporter /bin/smartctl_exporter \ | ||
&& chmod +x /bin/smartctl_exporter \ | ||
&& rm -r /tmp/smartctl_exporter-${VERSION}.${TARGETOS}-${TARGETARCH} /tmp/smartctl_exporter.tar.gz | ||
|
||
|
||
# Expose the port for the smartctl_exporter | ||
EXPOSE 9633 | ||
|
||
# Set the user to nobody | ||
USER nobody | ||
|
||
# Specify the entry point for the container | ||
ENTRYPOINT ["/bin/smartctl_exporter"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process | ||
process: | ||
smartctl_export: | ||
running: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env python | ||
|
||
import requests | ||
import json | ||
|
||
# Get the latest version of matchbox | ||
|
||
URL = "https://api.github.com/repos/prometheus-community/smartctl_exporter/releases/latest" | ||
|
||
def get_latest(channel): | ||
r = requests.get(URL) | ||
data = json.loads(r.text) | ||
version = data['tag_name'].removeprefix("v") | ||
return version | ||
|
||
if __name__ == "__main__": | ||
import sys | ||
channel = sys.argv[1] | ||
print(get_latest(channel)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
app: "smartctl-exporter" | ||
base: false | ||
semantic_versioning: true | ||
channels: | ||
- name: "stable" | ||
platforms: | ||
- linux/arm64 | ||
- linux/amd64 | ||
stable: true | ||
tests: | ||
enabled: true | ||
type: web |