From dd7c9ffcc4ace7063a54efcb46cb6bb7c3971bde Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Mon, 17 Mar 2025 12:09:59 +0200 Subject: [PATCH] docker*: add option placeholders (#15952) --- pages/common/docker-exec.md | 12 ++++++------ pages/common/docker-images.md | 6 +++--- pages/common/docker-logs.md | 6 +++--- pages/common/docker-ps.md | 14 +++++++------- pages/common/docker-pull.md | 6 +++--- pages/common/docker-rm.md | 6 +++--- pages/common/docker-run.md | 10 +++++----- pages/common/docker-start.md | 2 +- pages/common/docker.md | 8 ++++---- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/pages/common/docker-exec.md b/pages/common/docker-exec.md index a39aa3bdd8..06353a0376 100644 --- a/pages/common/docker-exec.md +++ b/pages/common/docker-exec.md @@ -5,24 +5,24 @@ - Enter an interactive shell session on an already-running container: -`docker exec --interactive --tty {{container_name}} {{/bin/bash}}` +`docker exec {{[-it|--interactive --tty]}} {{container_name}} {{/bin/bash}}` - Run a command in the background (detached) on a running container: -`docker exec --detach {{container_name}} {{command}}` +`docker exec {{[-d|--detach]}} {{container_name}} {{command}}` - Select the working directory for a given command to execute into: -`docker exec --interactive --tty --workdir {{path/to/directory}} {{container_name}} {{command}}` +`docker exec {{[-it|--interactive --tty]}} {{[-w|--workdir]}} {{path/to/directory}} {{container_name}} {{command}}` - Run a command in background on existing container but keep `stdin` open: -`docker exec --interactive --detach {{container_name}} {{command}}` +`docker exec {{[-i|--interactive]}} {{[-d|--detach]}} {{container_name}} {{command}}` - Set an environment variable in a running Bash session: -`docker exec --interactive --tty --env {{variable_name}}={{value}} {{container_name}} {{/bin/bash}}` +`docker exec {{[-it|--interactive --tty]}} {{[-e|--env]}} {{variable_name}}={{value}} {{container_name}} {{/bin/bash}}` - Run a command as a specific user: -`docker exec --user {{user}} {{container_name}} {{command}}` +`docker exec {{[-u|--user]}} {{user}} {{container_name}} {{command}}` diff --git a/pages/common/docker-images.md b/pages/common/docker-images.md index 20fb612e6a..9e62eaea37 100644 --- a/pages/common/docker-images.md +++ b/pages/common/docker-images.md @@ -9,15 +9,15 @@ - List all Docker images including intermediates: -`docker images --all` +`docker images {{[-a|--all]}}` - List the output in quiet mode (only numeric IDs): -`docker images --quiet` +`docker images {{[-q|--quiet]}}` - List all Docker images not used by any container: -`docker images --filter dangling=true` +`docker images {{[-f|--filter]}} dangling=true` - List images that contain a substring in their name: diff --git a/pages/common/docker-logs.md b/pages/common/docker-logs.md index 41a95e250e..c5871dd798 100644 --- a/pages/common/docker-logs.md +++ b/pages/common/docker-logs.md @@ -9,15 +9,15 @@ - Print logs and follow them: -`docker logs -f {{container_name}}` +`docker logs {{[-f|--follow]}} {{container_name}}` - Print last 5 lines: -`docker logs {{container_name}} --tail {{5}}` +`docker logs {{container_name}} {{[-n|--tail]}} {{5}}` - Print logs and append them with timestamps: -`docker logs -t {{container_name}}` +`docker logs {{[-t|--timestamps]}} {{container_name}}` - Print logs from a certain point in time of container execution (i.e. 23m, 10s, 2013-01-02T13:23:37): diff --git a/pages/common/docker-ps.md b/pages/common/docker-ps.md index e3528c2317..bb1d1fd204 100644 --- a/pages/common/docker-ps.md +++ b/pages/common/docker-ps.md @@ -9,28 +9,28 @@ - List all Docker containers (running and stopped): -`docker ps --all` +`docker ps {{[-a|--all]}}` - Show the latest created container (includes all states): -`docker ps --latest` +`docker ps {{[-l|--latest]}}` - Filter containers that contain a substring in their name: -`docker ps --filter "name={{name}}"` +`docker ps {{[-f|--filter]}} "name={{name}}"` - Filter containers that share a given image as an ancestor: -`docker ps --filter "ancestor={{image}}:{{tag}}"` +`docker ps {{[-f|--filter]}} "ancestor={{image}}:{{tag}}"` - Filter containers by exit status code: -`docker ps --all --filter "exited={{code}}"` +`docker ps {{[-a|--all]}} {{[-f|--filter]}} "exited={{code}}"` - Filter containers by status (created, running, removing, paused, exited and dead): -`docker ps --filter "status={{status}}"` +`docker ps {{[-f|--filter]}} "status={{status}}"` - Filter containers that mount a specific volume or have a volume mounted in a specific path: -`docker ps --filter "volume={{path/to/directory}}" --format "table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Mounts}}"` +`docker ps {{[-f|--filter]}} "volume={{path/to/directory}}" --format "table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Mounts}}"` diff --git a/pages/common/docker-pull.md b/pages/common/docker-pull.md index 857e7bd01d..be4d94f402 100644 --- a/pages/common/docker-pull.md +++ b/pages/common/docker-pull.md @@ -9,11 +9,11 @@ - Download a specific Docker image in quiet mode: -`docker pull --quiet {{image}}:{{tag}}` +`docker pull {{[-q|--quiet]}} {{image}}:{{tag}}` - Download all tags of a specific Docker image: -`docker pull --all-tags {{image}}` +`docker pull {{[-a|--all-tags]}} {{image}}` - Download a Docker images for a specific platform, e.g. linux/amd64: @@ -21,4 +21,4 @@ - Display help: -`docker pull --help` +`docker pull {{[-h|--help]}}` diff --git a/pages/common/docker-rm.md b/pages/common/docker-rm.md index d46ff4d2c4..f3d434c9cb 100644 --- a/pages/common/docker-rm.md +++ b/pages/common/docker-rm.md @@ -9,12 +9,12 @@ - Force remove a container: -`docker rm --force {{container1 container2 ...}}` +`docker rm {{[-f|--force]}} {{container1 container2 ...}}` - Remove a container and its volumes: -`docker rm --volumes {{container}}` +`docker rm {{[-v|--volumes]}} {{container}}` - Display help: -`docker rm --help` +`docker rm {{[-h|--help]}}` diff --git a/pages/common/docker-run.md b/pages/common/docker-run.md index 4bd1201aa0..c2126303cd 100644 --- a/pages/common/docker-run.md +++ b/pages/common/docker-run.md @@ -9,23 +9,23 @@ - Run command in a new container in background and display its ID: -`docker run --detach {{image}} {{command}}` +`docker run {{[-d|--detach]}} {{image}} {{command}}` - Run command in a one-off container in interactive mode and pseudo-TTY: -`docker run --rm --interactive --tty {{image}} {{command}}` +`docker run --rm {{[-i|--interactive]}} {{[-t|--tty]}} {{image}} {{command}}` - Run command in a new container with passed environment variables: -`docker run --env '{{variable}}={{value}}' --env {{variable}} {{image}} {{command}}` +`docker run {{[-e|--env]}} '{{variable}}={{value}}' {{[-e|--env]}} {{variable}} {{image}} {{command}}` - Run command in a new container with bind mounted volumes: -`docker run --volume {{/path/to/host_path}}:{{/path/to/container_path}} {{image}} {{command}}` +`docker run {{[-v|--volume]}} {{/path/to/host_path}}:{{/path/to/container_path}} {{image}} {{command}}` - Run command in a new container with published ports: -`docker run --publish {{host_port}}:{{container_port}} {{image}} {{command}}` +`docker run {{[-p|--publish]}} {{host_port}}:{{container_port}} {{image}} {{command}}` - Run command in a new container overwriting the entrypoint of the image: diff --git a/pages/common/docker-start.md b/pages/common/docker-start.md index 28a418b922..ce81454925 100644 --- a/pages/common/docker-start.md +++ b/pages/common/docker-start.md @@ -13,7 +13,7 @@ - Start a container, attaching `stdout` and `stderr` and forwarding signals: -`docker start --attach {{container}}` +`docker start {{[-a|--attach]}} {{container}}` - Start one or more containers: diff --git a/pages/common/docker.md b/pages/common/docker.md index 660fbd1d36..f59a0dc2d9 100644 --- a/pages/common/docker.md +++ b/pages/common/docker.md @@ -6,7 +6,7 @@ - List all Docker containers (running and stopped): -`docker ps --all` +`docker ps {{[-a|--all]}}` - Start a container from an image, with a custom name: @@ -24,9 +24,9 @@ `docker images` -- Open an [i]nteractive [t]ty with Bourne shell (`sh`) inside a running container: +- Open an interactive tty with Bourne shell (`sh`) inside a running container: -`docker exec -it {{container_name}} {{sh}}` +`docker exec {{[-it|--interactive --tty]}} {{container_name}} {{sh}}` - Remove stopped containers: @@ -34,4 +34,4 @@ - Fetch and follow the logs of a container: -`docker logs -f {{container_name}}` +`docker logs {{[-f|--follow]}} {{container_name}}`