From 7ece385c666eecf5f5c79f9218287b9d76227290 Mon Sep 17 00:00:00 2001 From: rebron1900 Date: Sun, 31 Dec 2023 12:34:43 +0800 Subject: [PATCH] build docker v2.5 --- etc/dockerfile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/etc/dockerfile b/etc/dockerfile index ff56220..68782a8 100644 --- a/etc/dockerfile +++ b/etc/dockerfile @@ -1,13 +1,12 @@ FROM golang:1.21.5-alpine AS build -RUN apk add build-base git -WORKDIR /src -COPY . . -ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE" -RUN make build_linux +RUN apk add --no-cache build-base git -FROM alpine:latest -RUN apk add --no-cache ca-certificates && \ - update-ca-certificates -COPY --from=build /src/_output/linux/yarr /usr/local/bin/yarr -EXPOSE 7070 -CMD ["/usr/local/bin/yarr", "-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"] +WORKDIR /src +RUN git clone https://github.com/nkanaev/yarr.git . +ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE" +RUN make build_default + +FROM alpine:3.19 +COPY --from=build /src/_output/yarr /usr/local/bin/yarr +RUN mkdir /data +CMD ["/usr/local/bin/yarr", "-addr", "0.0.0.0:7070", "-db", "/data/yarr.db"] \ No newline at end of file