Merge branch '9-reduce-docker-image-size' into 'main'
Resolve "Reduce docker image size" Closes #9 See merge request hectorjsmith/fail2ban-prometheus-exporter!15
This commit is contained in:
commit
7b1ff91ede
10
Dockerfile
10
Dockerfile
@ -1,5 +1,5 @@
|
||||
# Using golang:latest instead of alpine because of issues with sqlite3
|
||||
FROM golang:latest
|
||||
FROM golang:latest AS build
|
||||
|
||||
# Create build folder to compile tool
|
||||
WORKDIR /build
|
||||
@ -11,12 +11,14 @@ RUN ln -s /go/src/ /build/src
|
||||
# Compile the tool using a Make command
|
||||
RUN make build/docker
|
||||
|
||||
|
||||
FROM debian:buster-slim
|
||||
|
||||
# Create main app folder to run from
|
||||
WORKDIR /app
|
||||
|
||||
# Move compiled binary to app folder and delete build folder
|
||||
RUN mv /build/src/exporter /app/fail2ban-prometheus-exporter
|
||||
RUN rm -rf /build
|
||||
# Copy compiled binary to release image
|
||||
COPY --from=build /build/src/exporter /app/fail2ban-prometheus-exporter
|
||||
|
||||
# Copy init script into main app folder and set as entry point
|
||||
COPY docker/run.sh /app/
|
||||
|
Loading…
Reference in New Issue
Block a user