FIND YOUR NEXT FEW LINES

Results for “Processes & environment”

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

140 snippets foundClear filters
Docker / ComposeGetting Started

Set an example container hostname

Docker / Compose: Set an example container hostname using a locally available Ubuntu image.

Docker / Compose✓ Tested
Docker / ComposeBuild images

Set an image’s default command

Use JSON array syntax for a predictable command.

Dockerfile✓ Tested
Docker / ComposeLimits & process security

Set and inspect a fractional CPU limit

Docker / Compose: The cpus option records a limit in units of one billion NanoCPUs.

Docker / Compose✓ Tested
Docker / ComposeStorage & isolation

Set and inspect a memory limit

Apply a per-container limit when creating a container.

memory✓ Tested
Docker / ComposeDockerfile patterns

Set copied files’ numeric ownership

Docker / Compose: COPY --chown sets ownership while adding the file.

Docker / Compose✓ Tested
Docker / ComposeCompose service options

Set no-new-privileges in Compose

Docker / Compose: security_opt configures the process privilege restriction.

Docker / Compose✓ Tested
Docker / ComposeLimits & process security

Set the open-file limit for a process

Docker / Compose: The nofile ulimit sets soft and hard file descriptor limits.

Docker / Compose✓ Tested
Docker / ComposeStorage & isolation

Share data through a named volume

Keep a file across two short-lived containers.

volume✓ Tested
Docker / ComposeContainer lifecycle

Start an existing container and attach to its output

Docker / Compose: create records the command; start with attach runs that existing container.

Docker / Compose✓ Tested
Docker / ComposeContainer lifecycle

Stop a running container gracefully

Docker / Compose: stop sends the configured stop signal and waits before forcing termination.

Docker / Compose✓ Tested
Bash ScriptsLoops & decisions

Sum a range of integers

Use an arithmetic loop without launching external processes.

arithmetic✓ Tested
Docker / ComposeCompose service options

Supply a default for an unset Compose variable

Docker / Compose: The default interpolation form supplies a value when the variable is absent or empty.

Docker / Compose✓ Tested