-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile
39 lines (28 loc) · 929 Bytes
/
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
ARG IMAGE_ARCH=arm
# For arm64 use:
#ARG IMAGE_ARCH=arm64
# --------- BUILD
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-1 AS Build
ARG IMAGE_ARCH
COPY . /build
WORKDIR /build
# build
RUN dotnet restore && \
dotnet build && \
dotnet build -r linux-${IMAGE_ARCH} && \
dotnet publish -r linux-${IMAGE_ARCH}
# --------- DEPLOY
FROM --platform=linux/$IMAGE_ARCH torizonextras/dotnet-wayland-debug:latest AS Deploy
ARG IMAGE_ARCH
# install deps
RUN apt-get -y update && apt-get install -y --no-install-recommends \
procps \
&& apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
# copy the static docker
COPY Assets/docker-$IMAGE_ARCH /usr/bin/docker
RUN chmod +x /usr/bin/docker
RUN addgroup docker && groupmod --non-unique --gid 990 docker && adduser torizon docker
# copy project
COPY --from=Build /build/bin/Debug/net5.0/linux-${IMAGE_ARCH}/publish /project
USER torizon
CMD ["./project/DockerClones"]