FIND YOUR NEXT FEW LINES

Results for “Dockerfile patterns”

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

46 snippets foundClear filters
RustTesting & reusable patterns

Write formatted text into a byte buffer

Write formatted text into a byte buffer in a complete Rust program using the standard library.

Rust✓ Tested
Docker / ComposeGetting Started

Build an image with a default command

Docker / Compose: Build an image with a default command with a complete introductory Dockerfile.

Docker / Compose✓ Tested
Docker / ComposeGetting Started

Choose an image’s default directory

Docker / Compose: Choose an image’s default directory with a complete introductory Dockerfile.

Docker / Compose✓ Tested
Docker / ComposeGetting Started

Create a small file at build time

Docker / Compose: Create a small file at build time with a complete introductory Dockerfile.

Docker / Compose✓ Tested
Bash ScriptsLoops & decisions

Dispatch a command with case

Choose an action from a small set of supported commands.

case✓ Tested
Docker / ComposeNetworks & volume metadata

List only volumes matching a label

Docker / Compose: A label filter avoids relying on broad name patterns.

Docker / Compose✓ Tested
Bash ScriptsVariables & text

Replace every occurrence in a string

Substitute text directly with Bash parameter expansion.

replace✓ Tested
Docker / ComposeGetting Started

Separate an executable from default arguments

Docker / Compose: Separate an executable from default arguments with a complete introductory Dockerfile.

Docker / Compose✓ Tested
Docker / ComposeGetting Started

Set a default non-root image user

Docker / Compose: Set a default non-root image user with a complete introductory Dockerfile.

Docker / Compose✓ Tested
C#Types & reliable control flow

Use a switch expression to classify a value

C#: Relational patterns express a small ordered range classification.

C#✓ Tested