FIND YOUR NEXT FEW LINES

Results for “command substitution”

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

301 snippets foundClear filters
Docker / ComposeCompose service options

Pass dollar expressions through Compose

Docker / Compose: Double dollar signs defer expansion to the container shell.

Docker / Compose✓ Tested
PowerShellFunctions & control

Pass named parameters from a hashtable

Keep a command’s options together in a reusable object.

splatting✓ Tested
Docker / ComposeExecution & file transfer

Pipe input into a container process

Docker / Compose: The interactive flag keeps standard input open without allocating a terminal.

Docker / Compose✓ Tested
Docker / ComposeDockerfile patterns

Prepare an owned directory before dropping root

Docker / Compose: Create and chown the writable application path before USER.

Docker / Compose✓ Tested
Bash ScriptsProcesses & environment

Preserve a failure status while an EXIT trap runs

Bash Scripts: Capture the status immediately on entry to the trap before running cleanup commands.

Bash Scripts✓ Tested
Docker / ComposeLimits & process security

Prevent gaining privileges through exec

Docker / Compose: The no-new-privileges flag is visible in process status.

Docker / Compose✓ Tested
Docker / ComposeCompose service options

Protect a Compose service’s root filesystem

Docker / Compose: read_only rejects writes to the image filesystem.

Docker / Compose✓ Tested
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 / ComposeGetting Started

Read a completed example’s output

Docker / Compose: Read a completed example’s output using a locally available Ubuntu image.

Docker / Compose✓ Tested
Docker / ComposeContainer commands

Read a field from container metadata

Use an inspect template for stable machine-readable output.

inspect✓ Tested
Docker / ComposeCompose service options

Read a secret from a mounted file

Docker / Compose: Compose secrets make a file available under /run/secrets.

Docker / Compose✓ Tested