-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.alpine
35 lines (32 loc) · 1.12 KB
/
Dockerfile.alpine
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
# Base image for building ALSA and Opus
FROM rust:alpine as build-base
RUN apk add --no-cache build-base gcc musl-dev openssl-dev perl cmake g++ pkgconf linux-headers wget tar
# Build ALSA
FROM build-base as alsa-build
ARG ALSA_VERSION=1.2.9
WORKDIR /build
RUN wget https://www.alsa-project.org/files/pub/lib/alsa-lib-${ALSA_VERSION}.tar.bz2 && \
tar -xvf alsa-lib-${ALSA_VERSION}.tar.bz2 && \
cd alsa-lib-${ALSA_VERSION} && \
./configure --enable-static --disable-shared && \
make -j$(nproc) && \
make install
# Build Opus
FROM build-base as opus-build
ARG OPUS_VERSION=1.5.1
WORKDIR /build
RUN wget https://downloads.xiph.org/releases/opus/opus-${OPUS_VERSION}.tar.gz && \
tar -vxf opus-${OPUS_VERSION}.tar.gz && \
cd opus-${OPUS_VERSION} && \
./configure --enable-static --disable-shared && \
make -j$(nproc) && \
make install
# Final image
FROM build-base as final
COPY --from=alsa-build /usr/lib /usr/lib
COPY --from=opus-build /usr/local /usr/local
RUN apk add --no-cache alsa-lib-dev opus-dev
WORKDIR /usr/src/insanity
COPY . .
RUN cargo install --path insanity-native-tui-app
ENTRYPOINT ["insanity"]