Skip to content

Commit 4aa435e

Browse files
tandy-1000sentriz
andauthored
feat(docker): include essentia extractor binary in container image (#162)
* Include essentia extractor binary in container image Essentia provides binaries for x86_64 Linux and i686. The 32 bit binaries are not included as it is unlikely that they will be used. The `essentia-extractors` stage will only execute for 64 bit image builds. * fixup! correction Co-authored-by: Senan Kelly <senan@senan.xyz> * fixup! mistake * pin version; copy with * to work on other platforms; extract only the binary to /tmp closes #161 --------- Co-authored-by: Senan Kelly <senan@senan.xyz>
1 parent f2bd09c commit 4aa435e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,23 @@ RUN \
1212
--mount=type=cache,target=/root/.cache/go-build \
1313
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/ ./cmd/...
1414

15+
FROM alpine:3.22 AS essentia-extractors
16+
ARG VERSION="v2.1_beta2"
17+
ARG TARGETARCH
18+
WORKDIR /tmp
19+
RUN if [ "$TARGETARCH" = "amd64" ]; then \
20+
apk add --no-cache curl tar; \
21+
curl -fL -o essentia-extractors.tar.gz https://essentia.upf.edu/extractors/essentia-extractors-${VERSION}-linux-x86_64.tar.gz; \
22+
tar -xzf essentia-extractors.tar.gz --strip-components=1 -- essentia-extractors-${VERSION}/streaming_extractor_music; \
23+
fi
24+
1525
FROM alpine:3.22
1626
LABEL org.opencontainers.image.source=https://github.com/sentriz/wrtag
1727
RUN apk add -U --no-cache \
1828
su-exec \
1929
rsgain
2030
COPY --from=builder /out/* /usr/local/bin/
31+
COPY --from=essentia-extractors /tmp/streaming_extractor_music* /usr/local/bin/
2132
COPY docker-entry /
2233
ENTRYPOINT ["/docker-entry"]
2334
CMD ["wrtagweb"]

0 commit comments

Comments
 (0)