Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.build
.cache
.devcontainer
shell_exporter
*.tar.gz
vendor
vendor
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
FROM golang:1.14.1-alpine AS build-env
FROM golang:1.25-alpine AS build-env

RUN apk add --update git gcc libc-dev
RUN go get -u github.com/prometheus/promu

RUN mkdir shell_exporter
COPY .promu.yml shell_exporter.go go.mod go.sum /go/shell_exporter/
RUN apk add git gcc libc-dev
RUN go install github.com/prometheus/promu@v0.17.0

WORKDIR /go/shell_exporter
COPY .promu.yml shell_exporter.go go.mod go.sum ./
RUN promu build

FROM alpine:3.11
FROM alpine:3.22.2
RUN apk add --no-cache bash
COPY --from=build-env /go/shell_exporter/shell_exporter /bin/shell_exporter
COPY config.yml /etc/shell_exporter/config.yml
Expand Down
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
app:
build:
context: .
image: ozhiwei/shell_exporter
container_name: shell_exporter
restart: always
ports:
- 9191:9191
volumes:
- ./config.yml:/etc/shell_exporter/config.yml
30 changes: 16 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
module github.com/ozhiwei/shell_exporter

go 1.14
go 1.24.0

require (
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/google/go-github/v25 v25.1.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/common v0.10.0
github.com/prometheus/promu v0.5.0 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/yaml.v2 v2.3.0
github.com/prometheus/client_golang v1.23.2
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.1 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
golang.org/x/sys v0.37.0 // indirect
google.golang.org/protobuf v1.36.10 // indirect
)
Loading