Մι∩z•thedev · Follow
Published in Coding · 6 min read · 1 day ago
__
👏65k 💬321 🔖 ⤴️
__
Dive
is a utility to browse docker image https://github.com/wagoodman/dive.
Basically a docker image is a sandwich whose slices are called steps and stages. The FROM
instruction in the Dockerfile
says copy that sandwich, I’ll customize it with my toppings…
There you go !
Dive
let you lift each slice and check the ingredients the previous cook put in, the ingredients you put as well. Hence you can ponder if all the stuff was really necessary and in case the answer is no, try to remove some to make the sandwich still good but more digestible. Let’s trim down the fat and move the belly swiftly !
I had to upgrade my Dive
command-line utility, in order to browse my docker images, after my Docker Desktop upgrade to 4.29.
Indeed, docker changed image format to be OCI compatible.
My Dive
was v0.10.0. Check that with dive -v
.
Hopefully v0.12.0 fixes the issue.
Get it with elevated choco install -y dive --version=0.12.0
dive bookingapi
appsettings.*.json
, should advantageously be moved toward the last stage in the dockerfile, after the build and publish, so that all previous stages are restored from cache. Prior to that, I moved the appsettings.*.json
off the project directory, above indeed, so that they are excluded from the build.dotnet restore
and dotnet build
stages in several chunks, ordered by compilation priority or something that would probably help speeding up, like Business -> Libs -> Infra -> App