sb-server-monitor/Dockerfile

25 lines
540 B
Docker

FROM golang:1.22.2-bookworm AS build
# Create build workspace folder
WORKDIR /workspace
ADD . /workspace
# Install updates and build tools
RUN apt-get update --yes && \
apt-get install --yes build-essential
# Build the actual binary
RUN CGO_ENABLED=0 go build -o sb-server-monitor main.go
# -- -- -- -- -- --
# Set up image to run the tool
FROM alpine
# Create main app folder to run from
WORKDIR /app
# Copy built binary from build image
COPY --from=build /workspace/sb-server-monitor /app
ENTRYPOINT ["/app/sb-server-monitor"]