-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.alpine
33 lines (25 loc) · 1006 Bytes
/
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
FROM amd64/alpine:3.15 AS build
ARG version="3.0.0"
ARG information_version="v3.0.0"
RUN apk update \
&& apk add clang build-base bash zlib-dev icu-libs
RUN mkdir -p /usr/share/dotnet && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
RUN wget https://dot.net/v1/dotnet-install.sh \
&& chmod +x ./dotnet-install.sh \
&& ./dotnet-install.sh --channel 9.0 --install-dir /usr/share/dotnet
WORKDIR /source
# Configs change less frequently than code.
# Make configs & dependencies a separate layer to improve caching & build time on code change.
COPY Directory.Build.props Directory.Build.props
COPY src/D2L.Bmx/D2L.Bmx.csproj src/D2L.Bmx/D2L.Bmx.csproj
RUN dotnet restore src/D2L.Bmx -r linux-musl-x64
COPY . .
RUN dotnet publish src/D2L.Bmx \
-p:Version="$version" \
-p:InformationVersion="$information_version" \
-p:IncludeSourceRevisionInInformationalVersion=false \
--no-restore \
-r linux-musl-x64 \
-o app
FROM scratch as export
COPY --from=build /source/app /