Skip to content

Commit

Permalink
docs: add docker examples
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDark committed Oct 30, 2024
1 parent 287d257 commit 99c5040
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# syntax=docker/dockerfile:1

FROM golang:1.23 AS BUILD
WORKDIR /app

# Download Go modules
COPY go.mod go.sum ./
RUN go mod download

# Copy the source code. Note the slash at the end, as explained in
# https://docs.docker.com/reference/dockerfile/#copy
COPY *.go ./

# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o /turbostat-exporter

FROM debian:12.7-slim

RUN <<EOF
apt update
apt install -y linux-cpupower
rm -rf /var/lib/apt/lists/*
EOF

COPY --from=BUILD /turbostat-exporter /usr/bin/turbostat-exporter
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.8"
services:
tub:
image: test:test
privileged: true
environment: []
volumes:
- /dev:/dev

0 comments on commit 99c5040

Please sign in to comment.