Skip to content
All writing Part 05 of 12 · Remote-Controlling Chrome in Containers
Engineering · 3 min read

Docker Entrypoint: The Morning Checklist

A container entrypoint script starts socat, verifies it is alive, then hands PID 1 to Chrome with exec. Without exec, Chrome never receives SIGTERM.

The Morning Checklist

A container is a store. The entrypoint script is the morning checklist that Kubernetes runs once at startup.

chrome-entrypoint.sh socat ... & start receptionist kill -0 $SOCAT_PID alive check dead abort (exit 1) alive continue exec chrome "$@" PID 1 handoff + forward all Helm args

PID 1 = The Manager Badge

Every container has one main process (PID 1). Kubernetes sends SIGTERM (“please close”) only to PID 1.

Without exec PID 1 = script K8s sends SIGTERM here Chrome (PID 2) never hears it With exec PID 1 = Chrome K8s sends SIGTERM here script is gone, Chrome handles it

Without exec, Chrome never hears “please close.” Kubernetes waits 30 seconds, then kills everything.

Where Do the Arguments Come From?

Helm deployment.yaml args: ['--headless', '--remote-debugging-port=9223'] K8s runs entrypoint.sh --headless --remote-debugging-port=9223 = "$@" exec chrome --headless --remote-debugging-port=9223 "$@" forwards all args as-is

The readiness probe runs wget http://127.0.0.1:9222/json/version every 15 seconds. This request goes through socat. If socat dies, the probe fails and Kubernetes removes the pod from DNS.

“exec does not run a program. It becomes that program.”


References:

Related: see the port contract and config chain that feeds these args, or go back to the series overview.

Tags #kubernetes #chrome-devtools #containers
// connect

Be brave | Be wise | Be grateful

21 BreakinCode

// elsewhere
LinkedInMedium (lang: en)Life RecordYoutube
wh:~$William Hung· © 2026 Taipei · GMT+8 · Available for collaboration