/
Containerfile.cache
28 lines (18 loc) · 969 Bytes
/
Containerfile.cache
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
# https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-3.1
# https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile.alpine-x64
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS build
RUN apk --no-cache add bash
WORKDIR /
COPY mikeandwan.us.sln .
COPY nuget.config .
COPY src/. src/
COPY tests/. tests/
RUN dotnet publish -o /build -c Release -r linux-musl-x64 --self-contained false /src/Maw.Cache.Sync/Maw.Cache.Sync.csproj
# build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine-amd64
WORKDIR /maw-cache-sync
COPY --from=build /build /maw-cache-sync/
# TODO: cant specify user yet given how we currently deal with certificates as it tries to write to filesystem:
# cp: can't create '/usr/local/share/ca-certificates/ca_2022-05-12.crt': Permission denied
#USER app
ENTRYPOINT [ "/maw-cache-sync/Maw.Cache.Sync" ]