Skip to content

Instantly share code, notes, and snippets.

@kkestell
Last active October 17, 2019 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkestell/503f46ef253261f25db5cf20c0f6cf69 to your computer and use it in GitHub Desktop.
Save kkestell/503f46ef253261f25db5cf20c0f6cf69 to your computer and use it in GitHub Desktop.
.NET Core 3.0 + Alpine 3.9 + PublishSingleFile
# BUILD
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-alpine AS build
WORKDIR /
COPY App/. ./app/
WORKDIR /app
RUN dotnet publish -c Release -r linux-musl-x64 -o out /p:PublishSingleFile=true
# RUN
FROM alpine:3.9 AS runtime
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV DOTNET_RUNNING_IN_CONTAINER true
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
RUN apk add --no-cache \
ca-certificates \
icu-libs \
krb5-libs \
libgcc \
libintl \
libssl1.1 \
libstdc++ \
zlib
WORKDIR /app
COPY --from=build /app/out ./
ENTRYPOINT ["./App"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment