Statefulness means that an application depends on data or behavior that must persist across operations or machine restarts. Databases are the clearest example: destroying their machine can destroy their data unless backup data exists. Containerized applications with this requirement are more difficult because containers are designed to be stateless, while many stateful systems were not designed for container or cluster operation. section 1.6 section 5.1.4
Use these contrasts to recognize statefulness:
- A stateless Python or Node.js application can be recreated after its machine is destroyed because its environment is described by requirements.txt or package.json. section 5.1.4
- A stateful database needs its data to persist somewhere; destroying the running machine can otherwise cause permanent data loss. section 5.1.4
- Stateful containerized applications commonly depend on communication with stateless application containers, such as a database serving a Python or Node.js application. section 6.4
Why modifying a running container is not persistence
Running docker run --rm -it ubuntu /bin/bash, installing NGINX, and then exiting creates only a temporary change. Starting the container again produces errors because the installed NGINX is gone. The repeatable fix is to modify the container image rather than rely on changes made inside an existing container. section 5.1.4
docker run --rm -it ubuntu /bin/bashcat /etc/nginx/sites-available/defaultnginx -vexit
Inspect the short command sequence that demonstrates temporary container changes and their disappearance after removal. section 5.1.4













