grafana-backuper/Dockerfile
Tom Neuber 2b2ae98da5
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
fix(Dockerfile): fix workdir definition
2024-12-07 02:21:35 +01:00

33 lines
693 B
Docker

FROM golang:1.23.4-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 grafana-backuper cmd/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
RUN chmod +x /app/grafana-backuper
# Copy the wrapper script
COPY entrypoint.sh /app
# Ensure the script is executable
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]