The snippet library.
Small, practical examples. Search by task or narrow things down below.
Make a Compose service’s filesystem read-only
Docker / Compose: Make a Compose service’s filesystem read-only in a small Compose file.
Docker / Compose✓ Tested
Pass a named configuration value
Docker / Compose: Pass a named configuration value using a locally available Ubuntu image.
Docker / Compose✓ Tested
Read a completed example’s output
Docker / Compose: Read a completed example’s output using a locally available Ubuntu image.
Docker / Compose✓ Tested
Run a Compose service as a numeric user
Docker / Compose: Run a Compose service as a numeric user in a small Compose file.
Docker / Compose✓ Tested
Run a process as an unprivileged user
Docker / Compose: Run a process as an unprivileged user using a locally available Ubuntu image.
Docker / Compose✓ Tested
Run with a read-only container filesystem
Docker / Compose: Run with a read-only container filesystem using a locally available Ubuntu image.
Docker / Compose✓ Tested
Run your first disposable container
Docker / Compose: Run your first disposable container using a locally available Ubuntu image.
Docker / Compose✓ Tested
Send text into a container through stdin
Docker / Compose: Send text into a container through stdin using a locally available Ubuntu image.
Docker / Compose✓ Tested
Separate an executable from default arguments
Docker / Compose: Separate an executable from default arguments with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Set a container’s working directory
Docker / Compose: Set a container’s working directory using a locally available Ubuntu image.
Docker / Compose✓ Tested
Set a default non-root image user
Docker / Compose: Set a default non-root image user with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Set a service’s working directory
Docker / Compose: Set a service’s working directory in a small Compose file.
Docker / Compose✓ Tested