-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (45 loc) · 2.1 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (45 loc) · 2.1 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# syntax=docker/dockerfile:1
# bump: rubberband /RUBBERBAND_VERSION=([\d.]+)/ https://github.com/breakfastquay/rubberband.git|^2
# bump: rubberband after ./hashupdate Dockerfile RUBBERBAND $LATEST
# bump: rubberband link "CHANGELOG" https://github.com/breakfastquay/rubberband/blob/default/CHANGELOG
# bump: rubberband link "Source diff $CURRENT..$LATEST" https://github.com/breakfastquay/rubberband/compare/$CURRENT..$LATEST
ARG RUBBERBAND_VERSION=2.0.2
ARG RUBBERBAND_URL="https://breakfastquay.com/files/releases/rubberband-$RUBBERBAND_VERSION.tar.bz2"
ARG RUBBERBAND_SHA256=b9eac027e797789ae99611c9eaeaf1c3a44cc804f9c8a0441a0d1d26f3d6bdf9
# Must be specified
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION} AS base
FROM base AS download
ARG RUBBERBAND_URL
ARG RUBBERBAND_SHA256
ARG WGET_OPTS="--retry-on-host-error --retry-on-http-error=429,500,502,503 -nv"
WORKDIR /tmp
RUN \
apk add --no-cache --virtual download \
coreutils wget tar && \
wget $WGET_OPTS -O rubberband.tar.bz2 "$RUBBERBAND_URL" && \
echo "$RUBBERBAND_SHA256 rubberband.tar.bz2" | sha256sum --status -c - && \
mkdir rubberband && \
tar xf rubberband.tar.bz2 -C rubberband --strip-components=1 && \
rm rubberband.tar.bz2 && \
apk del download
FROM base AS build
COPY --from=download /tmp/rubberband/ /tmp/rubberband/
WORKDIR /tmp/rubberband
RUN \
apk add --no-cache --virtual build \
build-base meson ninja pkgconf fftw-dev libsamplerate-dev && \
meson -Ddefault_library=static -Dfft=fftw -Dresampler=libsamplerate build && \
ninja -j$(nproc) -vC build install && \
echo "Requires.private: fftw3 samplerate" >> /usr/local/lib/pkgconfig/rubberband.pc && \
# Sanity tests
pkg-config --exists --modversion --path rubberband && \
ar -t /usr/local/lib/librubberband.a && \
readelf -h /usr/local/lib/librubberband.a && \
# Cleanup
apk del build
FROM scratch
ARG RUBBERBAND_VERSION
COPY --from=build /usr/local/lib/pkgconfig/rubberband.pc /usr/local/lib/pkgconfig/rubberband.pc
COPY --from=build /usr/local/lib/librubberband.a /usr/local/lib/librubberband.a
COPY --from=build /usr/local/include/rubberband/ /usr/local/include/rubberband/