forked from ZhangGaoxing/alsa.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (37 loc) · 2.21 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
36
37
38
39
40
41
42
43
FROM mcr.microsoft.com/dotnet/core/sdk:2.1-stretch-arm32v7 AS build
# FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS build
WORKDIR /app
# publish app
COPY src .
WORKDIR /app/Alsa.Samples
RUN dotnet restore
RUN dotnet publish -c release -r linux-arm -o out
## run app
FROM mcr.microsoft.com/dotnet/core/runtime:2.1-stretch-slim-arm32v7 AS runtime
# FROM mcr.microsoft.com/dotnet/core/runtime:2.1 AS runtime
WORKDIR /app
COPY --from=build /app/Alsa.Samples/out ./
# configure apt sources
########################
# Debian #
########################
# RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free" >/etc/apt/sources.list && \
# echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free" >>/etc/apt/sources.list && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free" >>/etc/apt/sources.list && \
# echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free" >>/etc/apt/sources.list && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free" >>/etc/apt/sources.list && \
# echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free" >>/etc/apt/sources.list && \
# echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free" >>/etc/apt/sources.list && \
# echo "deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free" >>/etc/apt/sources.list
########################
# Raspbian #
########################
# RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak && \
# echo "deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib" >/etc/apt/sources.list && \
# echo "deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main non-free contrib" >>/etc/apt/sources.list
# install native dependencies
RUN apt-get update && \
apt-get install -y --allow-unauthenticated libasound2-dev && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["dotnet", "Alsa.Samples.dll"]