From 9827e6bcb222cf8ebb6c1e1583b374da93b9cd37 Mon Sep 17 00:00:00 2001 From: Michael Balsillie Date: Mon, 22 Aug 2022 12:06:44 +1200 Subject: [PATCH] fix dockerfile --- Dockerfile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8ee8db5..9372f74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,21 @@ ARG SHOUTRRR_VERSION=v0.6.1 FROM golang:bullseye AS builder -RUN git clone https://github.com/containrrr/shoutrrr.git shoutrrr && \ - cd ./shoutrrr && \ - git checkout ${SHOUTRRR_VERSION} && \ +ARG SHOUTRRR_VERSION +RUN git clone -b ${SHOUTRRR_VERSION} --depth 1 https://github.com/containrrr/shoutrrr.git ./shoutrrr +RUN cd ./shoutrrr && \ + mkdir /output && \ go build -o /output ./shoutrrr FROM debian:11-slim +RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections RUN apt-get update && \ - apt-get install -y bash curl jq ca-certificates && \ + apt-get -y --no-install-recommends install \ + bash \ + curl \ + jq \ + ca-certificates && \ rm -rf /var/lib/apt/lists/* - RUN ln -sf /bin/bash /bin/sh WORKDIR /root -COPY --from=builder /output ./shoutrrr -RUN chmod +x /root/shoutrrr/shoutrrr && \ - ln -sf /root/shoutrrr/shoutrrr /usr/bin/shoutrrr +COPY --from=builder /output/shoutrrr /usr/bin/shoutrrr +RUN chmod +x /usr/bin/shoutrrr