-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM golang:latest as builder
RUN go get github.com/gosimple/slug
RUN mkdir /build
COPY . /go/src/github.com/histrio/rssbook
WORKDIR /go/src/github.com/histrio/rssbook
RUN go get github.com/stretchr/testify
RUN make test
RUN make build
# ====================================================
FROM alpine:latest as downloader
RUN apk add curl tar xz upx
RUN curl https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz -o /tmp/ffmpeg-git-64bit-static.tar.xz
RUN tar -xf /tmp/ffmpeg-git-64bit-static.tar.xz --wildcards --no-anchored 'ffmpeg' --no-anchored 'ffprobe' --strip=1
RUN rm -rf /tmp/ffmpeg-git-64bit-static.tar.xz
RUN upx ffmpeg -o /ffmpeg.compressed
RUN upx ffprobe -o /ffprobe.compressed
COPY --from=builder /go/src/github.com/histrio/rssbook/build/rssbook /
RUN upx --best /rssbook
# ====================================================
FROM scratch
ADD empty /tmp/
COPY --from=downloader /ffmpeg.compressed /ffmpeg
COPY --from=downloader /ffprobe.compressed /ffprobe
COPY --from=downloader /rssbook /
ENV PATH /
ENTRYPOINT ["/rssbook", "--src", "/data", "--dst", "/data"]