Build bare image version of app for Linux docker
This commit is contained in:
parent
9a4487165b
commit
caaa8dcccf
|
|
@ -1,15 +1,8 @@
|
||||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
|
||||||
USER app
|
|
||||||
WORKDIR /app
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
||||||
# Install clang/zlib1g-dev dependencies for publishing to native
|
# Install clang/zlib1g-dev dependencies for publishing to native
|
||||||
RUN apt-get update \
|
RUN apk add clang zlib-static zlib-dev musl-dev libc6-compat cmake autoconf make openssl-dev openssl-libs-static icu-static icu-dev
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
clang zlib1g-dev
|
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY ["AS1024.NetworkQuality.Server/AS1024.NetworkQuality.Server.csproj", "AS1024.NetworkQuality.Server/"]
|
COPY ["AS1024.NetworkQuality.Server/AS1024.NetworkQuality.Server.csproj", "AS1024.NetworkQuality.Server/"]
|
||||||
|
|
@ -20,9 +13,11 @@ RUN dotnet build "./AS1024.NetworkQuality.Server.csproj" -c $BUILD_CONFIGURATION
|
||||||
|
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
RUN dotnet publish "./AS1024.NetworkQuality.Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=true
|
RUN dotnet publish "./AS1024.NetworkQuality.Server.csproj" -c $BUILD_CONFIGURATION -o /app/publish
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS final
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS final
|
||||||
|
WORKDIR /tmp
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /app/publish .
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue