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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.md
.git
.gitignore
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
ARG ARCH="amd64"
ARG GOARCH="amd64"
ARG GOOS="linux"
FROM docker.io/golang:1.17-bullseye AS build

# In the future, this should be refactored using HEREDOC
# However, not yet fully supported by some tools
RUN set -ex; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \
\
slurm-wlm

COPY . /go/src
WORKDIR src

RUN set -ex; \
go build -v -o /go/bin/prometheus-slurm-exporter

FROM docker.io/${ARCH}/debian:bullseye-slim

# In the future, this should be refactored using HEREDOC
# However, not yet fully supported by some tools
RUN set -ex; \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --no-install-recommends -y \
\
slurm-wlm \
\
&& apt-get -y autoclean; apt-get -y autoremove; \
rm -rf /var/lib/apt/lists/*

COPY --from=build /go/bin/prometheus-slurm-exporter /bin/slurm_exporter

EXPOSE 8080
USER nobody
# The Slurm and Munge files that need to be present at runtime
VOLUME /etc/slurm/slurm.conf /etc/munge/munge.key /run/munge/munge.socket.2
ENTRYPOINT ["/bin/slurm_exporter"]