forked from earthly/earthly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
23 lines (18 loc) · 792 Bytes
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
VERSION 0.6
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.302-alpine3.12
WORKDIR /dotnet-example
deps:
# copying project files and restoring NuGet packages allows docker to cache the layer and only re-build it when NuGet packages change
COPY src/HelloEarthly/HelloEarthly.csproj src/HelloEarthly/
RUN dotnet restore src/HelloEarthly
build:
FROM +deps
COPY src src
# make sure you have /bin and /obj in .earthlyignore, as their content from context might cause problems
RUN dotnet publish --no-restore src/HelloEarthly -o publish
SAVE ARTIFACT publish AS LOCAL publish
docker:
FROM mcr.microsoft.com/dotnet/core/runtime:3.1.6-alpine3.12
COPY +build/publish .
ENTRYPOINT ["dotnet", "HelloEarthly.dll"]
SAVE IMAGE --push earthly/examples:dotnet