Doug Wilson
Nov 8, 2023

Really good overview and starter document for Docker in general!

Other than the "FROM" ASP.NET Core runtime and SDK image value, this could be applied to almost any language.

I especially like your use of "EXPOSE", which specifies the service's listening port but correctly and importantly leaves routing traffic to this port to the infrastructure.

One addition you might consider when pushing an image to Docker Hub or to any container repository, e.g. AWS's Elastic Container Repository (ECR), is generating a build timestamp and including this value in the tags that describe the image:

TIMESTAMP="$(date +%Y%m%d_%H%M%S)"

Especially if/when you automate the build and deploy steps using a pipeline or automation tool, this can really help to identify the latest version, script the inclusion of a specific version in production, etc.

Doug Wilson
Doug Wilson

Written by Doug Wilson

Doug Wilson is an experienced software application architect, music lover, problem solver, former film/video editor, philologist, and father of four.

No responses yet