Add a healthcheck to a Dockerfile
Native Docker healthcheck with curl; this line goes into the Dockerfile
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD curl -sf http://localhost:8080/health || exit 1
More docker commands
-
docker scout cves --only-fixed myapp:latestShows only CVEs that already have a fix
-
docker run --rm -it --pid=host --network=host --privileged nicolaka/netshootNetwork debugging toolbox that shares the host PID namespace and network
-
docker buildx bake -f docker-bake.hcl --pushBuilds and pushes several targets from one HCL file, in parallel and without repeated definitions
-
docker buildx imagetools inspect <reg>/<name>:tag --format '{{json .Manifest}}'Shows the platforms in a manifest list without pulling layers; a quick check for arm64 and amd64
-
docker buildx create --name multi --use --driver docker-container --driver-opt network=hostCreates a BuildKit builder with multi-arch and cache export support; the default driver cannot do this