$ dotnet new webapi --language F# --output src/MyWeb
FROM mcr.microsoft.com/dotnet/core/sdk:5.0-alpine AS base
WORKDIR /app
COPY src/MyWeb/MyWeb.fsproj src/MyWeb/
RUN dotnet restore src/MyWeb
COPY src/MyWeb src/MyWeb
RUN dotnet publish src/MyWeb \
-r linux-musl-x64 \
-c Release \
-o /out \
-p:PublishTrimmed=true
FROM mcr.microsoft.com/dotnet/core/runtime-deps:5.0-alpine
WORKDIR /app
COPY --from=base /out ./
CMD ./MyWeb
EXPOSE 80
$ docker build -f Dockerfile -t wk/my-web .
$ docker images | grep wk/my-web
wk/my-web latest e03dd2b6b198 4 hours ago 72.4MB
Top comments (0)