Skip to content

Instantly share code, notes, and snippets.

View michaeldimoudis's full-sized avatar

Michael Dimoudis michaeldimoudis

View GitHub Profile
@michaeldimoudis
michaeldimoudis / Dockerfile
Last active June 29, 2021 20:27
Hardened ASP.NET Core 3.1 app on Alpine Dockerfile
ARG VERSION=3.1-alpine
# Acknowledgements:
# This file was dervied with the help of a combination of https://github.com/ironPeakServices/iron-alpine/blob/master/Dockerfile
# and these 2 blog posts https://medium.com/01001101/containerize-your-net-core-app-the-right-way-35c267224a8d and https://medium.com/asos-techblog/minimising-your-attack-surface-by-building-highly-specialised-docker-images-example-for-net-b7bb177ab647
# Stage 1: Build application
FROM mcr.microsoft.com/dotnet/core/sdk:$VERSION AS build-env
WORKDIR /build