Skip to content

Commit

Permalink
Merge pull request #48 from jeremyje/priv
Browse files Browse the repository at this point in the history
Fix crash on linux
  • Loading branch information
jeremyje authored Nov 30, 2022
2 parents 5a448b9 + b635ce3 commit b5095eb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/coretemp-exporter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ WORKDIR /app/
COPY --chown=nonroot $BINARY_PATH /app/coretemp-exporter
COPY --chown=nonroot LICENSE /app/LICENSE

EXPOSE 80
EXPOSE 8181
ENTRYPOINT ["/app/coretemp-exporter"]

# Standardized Docker Image Labels
Expand Down
2 changes: 1 addition & 1 deletion cmd/coretemp-exporter/Dockerfile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ COPY build/bin/windows_amd64/coretemp-exporter.exe /app/coretemp-exporter.exe
COPY LICENSE /app/LICENSE

USER ContainerUser
EXPOSE 80
EXPOSE 8181
ENTRYPOINT ["/app/coretemp-exporter.exe"]

# Standardized Docker Image Labels
Expand Down
9 changes: 7 additions & 2 deletions cmd/coretemp-exporter/coretemp-exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

var (
endpoint = flag.String("endpoint", ":8081", "Endpoint to serve metrics via HTTP.")
endpoint = flag.String("endpoint", ":8181", "Endpoint to serve metrics via HTTP.")
interval = flag.Duration("interval", time.Second, "Polling interval for temperature information")
logFile = flag.String("log", "", "ndjson (newline delimited json) log file")
console = flag.Bool("console", true, "Indicates that records should be printed to console.")
Expand All @@ -39,11 +39,16 @@ func init() {
func main() {
flag.Parse()

svcCmd := ""
if svc != nil {
svcCmd = *svc
}

internal.Run(&internal.Args{
Endpoint: *endpoint,
Interval: *interval,
Log: *logFile,
Console: *console,
ServiceControlCommand: *svc,
ServiceControlCommand: svcCmd,
})
}
8 changes: 8 additions & 0 deletions install/compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ services:
environment:
- METRICS_STORAGE_TYPE=prometheus
- PROMETHEUS_SERVER_URL=http://prometheus:9090
coretemp-exporter:
image: ghcr.io/jeremyje/coretemp-exporter:v0.5.1
hostname: coretemp-exporter
restart: always
networks:
- coretemp-net
ports:
- 8181:8181
volumes:
prom_data:
networks:
Expand Down
3 changes: 2 additions & 1 deletion install/compose/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ scrape_configs:
scheme: http
static_configs:
- targets:
- host.docker.internal:8080
- host.docker.internal:8181
- coretemp-exporter:8181

0 comments on commit b5095eb

Please sign in to comment.