Skip to content

CICD-133 · Make root filesystem read-only ​

Encyclopedia · Docker runtime and Compose · All snippets

Previous · CICD-132 · Next · CICD-134

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites disposable Docker or Compose project with example web service.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
docker run --rm --read-only --tmpfs /tmp:size=16m web:ci python -c 'print("read-only smoke")'

3. How it works ​

The command starts a container from the selected image under its declared network and resource options.

4. Verify the result ​

App needs dedicated writable mounts for expected state. Do not assume image startup supports read-only mode.

Validation syntax-validated (Bash parse). Status definitions.