FIND YOUR NEXT FEW LINES

Results for “Docker / Compose”

Small, practical examples. Search by task or narrow things down below.

129 snippets foundClear filters
Docker / ComposeBuild images

Provide a default environment value

Set a runtime default that can be overridden at startup.

Dockerfile✓ Tested
Docker / ComposeCompose applications

Put an optional service behind a profile

Keep a utility service separate from a normal Compose startup.

Compose✓ Tested
Docker / ComposeBuild images

Run an image as a non-root user

Choose an unprivileged numeric identity for the default process.

Dockerfile✓ Tested
Docker / ComposeBuild images

Set a working directory

Choose the default directory for later instructions and the running process.

Dockerfile✓ Tested
Docker / ComposeBuild images

Set an image’s default command

Use JSON array syntax for a predictable command.

Dockerfile✓ Tested
Docker / ComposeCompose applications

Set service environment values

Pass configuration through the Compose environment section.

Compose✓ Tested
Docker / ComposeCompose applications

Wait for an initialization job

Start a service only after its dependency completes successfully.

Compose✓ Tested
Docker / ComposeStorage & isolation

Attach containers to a user-defined network

Create a dedicated network for a small group of containers.

network✓ Tested
Docker / ComposeStorage & isolation

Mount a host directory read-only

Expose existing files without allowing the container to change them.

bind mount✓ Tested
Docker / ComposeContainer commands

Pass an environment variable

Supply configuration without changing an image.

environment✓ Tested
Docker / ComposeContainer commands

Read a field from container metadata

Use an inspect template for stable machine-readable output.

inspect✓ Tested
Docker / ComposeContainer commands

Read output from a completed container

Retrieve the stdout captured by Docker.

logs✓ Tested