Results for “Docker / Compose”
Small, practical examples. Search by task or narrow things down below.
Provide a default environment value
Set a runtime default that can be overridden at startup.
Dockerfile✓ Tested
Put an optional service behind a profile
Keep a utility service separate from a normal Compose startup.
Compose✓ Tested
Run an image as a non-root user
Choose an unprivileged numeric identity for the default process.
Dockerfile✓ Tested
Set a working directory
Choose the default directory for later instructions and the running process.
Dockerfile✓ Tested
Set an image’s default command
Use JSON array syntax for a predictable command.
Dockerfile✓ Tested
Set service environment values
Pass configuration through the Compose environment section.
Compose✓ Tested
Wait for an initialization job
Start a service only after its dependency completes successfully.
Compose✓ Tested
Attach containers to a user-defined network
Create a dedicated network for a small group of containers.
network✓ Tested
Mount a host directory read-only
Expose existing files without allowing the container to change them.
bind mount✓ Tested
Pass an environment variable
Supply configuration without changing an image.
environment✓ Tested
Read a field from container metadata
Use an inspect template for stable machine-readable output.
inspect✓ Tested
Read output from a completed container
Retrieve the stdout captured by Docker.
logs✓ Tested