2024-04-03 20:18:14 +02:00
|
|
|
FROM golang:1.22.2-bookworm AS build
|
2024-02-16 23:01:12 +01:00
|
|
|
|
|
|
|
# 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 grafana-backuper 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/grafana-backuper /app
|
|
|
|
|
|
|
|
ENTRYPOINT ["/app/grafana-backuper"]
|