# Topic 24: Containers and Platform Engineering

**Fictional Northstar case · self-paced · 45–90 minutes plus optional setup**

## Opening question
If the container restarts, what happens to its data?

## Explain
An image packages an application and its dependencies; a container runs an instance with configured isolation and resources. Containers commonly share a host kernel, unlike a separate full guest OS. Persistent storage, secrets, network policy and image provenance still need design. Platform engineering creates supported paths for teams to deploy and operate services, rather than only assemble tooling.

## Supporting technologies
- **Image and container:** Reusable artifact versus running instance.
- **Ports and storage:** Expose only required ports and persist intended data.
- **Orchestration:** Desired state and health checks support operation.
- **Platform service:** Provide repeatable workflows with ownership and guardrails.

## Scenario
Northstar proposes a containerized portal. Its content is stored only inside the disposable container writable layer.

```text
component,proposal
image,reviewed_sample
port,localhost_only
data,container_writable_layer
restart_policy,defined
backup,not_defined
```

## Hands-on procedure
1. Distinguish the image, container, host and persistent data in a diagram.
2. Identify which state must survive replacement and assign a volume or external store in the design.
3. Write a health check that represents useful portal behavior, not process existence alone.
4. Review an example configuration for privileged mode, unnecessary port exposure and embedded secrets.
5. Plan replacement, backup and restore tests; record which require an installed runtime.
6. Use the official Docker learning path for an optional isolated build and document cleanup.

## Expected reasoning and limits
The proposal risks losing writable-layer data on replacement. A restart policy is not a backup. Persistent storage still needs access control and recovery evidence.

## Best practices
- Use maintained images and verify provenance.
- Avoid privileged mode and run with restricted identity where supported.
- Bind local practice services to localhost.
- Test persistence, health and cleanup explicitly.

## Vendors, projects and learning
- [Docker](https://docs.docker.com/learn/paths/get-started-with-docker-containers/): Container learning and runtime example
- [Red Hat](https://docs.redhat.com/): Platform and container documentation
- [Kubernetes](https://kubernetes.io/docs/concepts/): Open-source orchestration project

## Optional technical extension
Follow the official local container tutorial with synthetic content. Review runtime licensing and machine requirements; do not expose a practice container to the public Internet.

## Career practice
Relevant role families to investigate: Platform support engineer, Junior DevOps engineer, Container platform technician. No current vacancy or hiring requirement is asserted.

Interview: How would you demonstrate that data survives application replacement?

## Sources
- [Docker learning path](https://docs.docker.com/learn/paths/get-started-with-docker-containers/)
- [Kubernetes basics](https://kubernetes.io/docs/tutorials/kubernetes-basics/)

## Portfolio evidence
Use the [portfolio guide](../guides/portfolio.md). Submit original input, decisions, tests, actual results, limitations and source attribution. Clearly label modeled, planned and performed work.

## Suggested prerequisites
Topic 6, Topic 7, Topic 22, Topic 23
