cli/docs/reference/commandline
Stephen Day 1a502e91c9
run: flag to include the Docker API socket
Adds a flag to the create and run command, `--use-api-socket`, that can
be used to start a container with the correctly configured parameters to
ensure that accessing the docker socket will work with out managing bind
mounts and authentication injection.

The implementation in this PR resolves the tokens for the current
credential set in the client and then copies it into a container at the
well know location of /run/secrets/docker/config.json, setting
DOCKER_CONFIG to ensure it is resolved by existing tooling. We use a
compose-compatible secret location with the hope that the CLI and
compose can work together seamlessly.

The bind mount for the socket is resolved from the current context,
erroring out if the flag is set and the provided socket is not a unix
socket.

There are a few drawbacks to this approach but it resolves a long
standing pain point. We'll continue to develop this as we understand
more use cases but it is marked as experimental for now.

Signed-off-by: Stephen Day <stephen.day@docker.com>
2025-04-15 10:57:44 -07:00
..
attach.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
bake.md add top-level "docker bake" command as alias for "docker buildx bake" 2025-04-11 16:28:47 +02:00
build.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
builder.md docs: generate markdown 2023-01-06 22:36:47 +01:00
builder_build.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
builder_prune.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
checkpoint.md docs: minor editorial improvements, typo fixes 2023-12-19 17:15:38 +01:00
checkpoint_create.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
checkpoint_ls.md docs: generate markdown 2023-01-06 22:36:47 +01:00
checkpoint_rm.md docs: generate markdown 2023-01-06 22:36:47 +01:00
commit.md docs: regenerate markdown 2024-02-21 10:40:13 +01:00
config.md docs: generate markdown 2023-01-06 22:36:47 +01:00
config_create.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
config_inspect.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
config_ls.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
config_rm.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
container.md docs: generate markdown 2023-01-06 22:36:47 +01:00
container_attach.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
container_commit.md docs: refresh image versions in examples 2024-07-24 09:47:36 +02:00
container_cp.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
container_create.md run: flag to include the Docker API socket 2025-04-15 10:57:44 -07:00
container_diff.md docs: rename cli reference aliases to canonical 2024-01-15 11:29:30 +01:00
container_exec.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
container_export.md docs: update internal links after refactor 2024-08-11 16:58:08 +02:00
container_inspect.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
container_kill.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
container_logs.md docs: update internal links after refactor 2024-08-11 16:58:08 +02:00
container_ls.md docs: update internal links after refactor 2024-08-11 16:58:08 +02:00
container_pause.md docs: rename cli reference aliases to canonical 2024-01-15 11:29:30 +01:00
container_port.md docs: rename cli reference aliases to canonical 2024-01-15 11:29:30 +01:00
container_prune.md docs: Link supported Go duration strings 2024-10-07 10:37:00 +02:00
container_rename.md docs: rename cli reference aliases to canonical 2024-01-15 11:29:30 +01:00
container_restart.md docs: fix broken anchor-link in "container restart" reference 2025-02-21 23:45:32 +01:00
container_rm.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
container_run.md run: flag to include the Docker API socket 2025-04-15 10:57:44 -07:00
container_start.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
container_stats.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
container_stop.md cli/command/container: stop, restart: rename "--time" to "--timeout" 2024-09-30 09:43:54 +02:00
container_top.md docs: rename cli reference aliases to canonical 2024-01-15 11:29:30 +01:00
container_unpause.md docs: rename cli reference aliases to canonical 2024-01-15 11:29:30 +01:00
container_update.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
container_wait.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
context.md docs: generate markdown 2023-01-06 22:36:47 +01:00
context_create.md docs: minor editorial improvements, typo fixes 2023-12-19 17:15:38 +01:00
context_export.md docs: generate markdown 2023-01-06 22:36:47 +01:00
context_import.md docs: generate markdown 2023-01-06 22:36:47 +01:00
context_inspect.md docs: generate markdown 2023-01-06 22:36:47 +01:00
context_ls.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
context_rm.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
context_show.md docs: generate markdown 2023-01-06 22:36:47 +01:00
context_update.md docs: generate markdown 2023-01-06 22:36:47 +01:00
context_use.md docs: minor editorial improvements, typo fixes 2023-12-19 17:15:38 +01:00
cp.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
create.md run: flag to include the Docker API socket 2025-04-15 10:57:44 -07:00
diff.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
docker.md add top-level "docker bake" command as alias for "docker buildx bake" 2025-04-11 16:28:47 +02:00
events.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
exec.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
export.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
history.md image/history: Add `--platform` flag 2024-10-10 17:00:43 +02:00
image.md docs: generate markdown 2023-01-06 22:36:47 +01:00
image_build.md docs, man: remove confusing example for "--isolation" 2025-01-02 12:15:08 +01:00
image_history.md image/history: Add `--platform` flag 2024-10-10 17:00:43 +02:00
image_import.md docs: rename cli reference aliases to canonical 2024-01-15 11:29:30 +01:00
image_inspect.md image/inspect: Add --platform flag 2025-04-11 15:53:41 +02:00
image_load.md image/load: Add `--platform` 2024-10-10 16:35:07 +02:00
image_ls.md image/list: Add `--tree` flag 2024-08-16 15:09:51 +02:00
image_prune.md docs: Link supported Go duration strings 2024-10-07 10:37:00 +02:00
image_pull.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
image_push.md push: Improve note message and colors 2024-07-10 11:36:40 +02:00
image_rm.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
image_save.md image/save: Add `--platform` 2024-10-10 16:35:03 +02:00
image_tag.md docs: update prose about image tag/name format 2024-10-17 12:36:32 +02:00
images.md image/list: Add `--tree` flag 2024-08-16 15:09:51 +02:00
import.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
index.md docs: update links to docker cli reference 2024-07-04 10:28:53 +02:00
info.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
inspect.md docker inspect: add support for swarm configs 2024-10-24 18:32:32 +02:00
kill.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
load.md image/load: Add `--platform` 2024-10-10 16:35:07 +02:00
login.md login: improve text on already authenticated and on OAuth login 2025-02-05 12:32:24 +01:00
logout.md docs: generate markdown 2023-01-06 22:36:47 +01:00
logs.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
manifest.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
manifest_annotate.md docs: generate markdown 2023-01-06 22:36:47 +01:00
manifest_create.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
manifest_inspect.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
manifest_push.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
manifest_rm.md docs: generate markdown 2023-01-06 22:36:47 +01:00
network.md docs: generate markdown 2023-01-06 22:36:47 +01:00
network_connect.md run, create, connect: add support for gw-priority 2024-12-03 15:13:08 +01:00
network_create.md Add option '--ipv4' 2024-12-10 15:51:21 +00:00
network_disconnect.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
network_inspect.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
network_ls.md docs: network ls add heading and anchor for "--no-trunc" 2025-02-21 23:51:04 +01:00
network_prune.md docs: Link supported Go duration strings 2024-10-07 10:37:00 +02:00
network_rm.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
node.md docs: generate markdown 2023-01-06 22:36:47 +01:00
node_demote.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
node_inspect.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
node_ls.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
node_promote.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
node_ps.md docs: update example redis tags from 3.0.x to 7.4.x 2024-11-05 11:20:17 +01:00
node_rm.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
node_update.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
pause.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
plugin.md docs: generate markdown 2023-01-06 22:36:47 +01:00
plugin_create.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
plugin_disable.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
plugin_enable.md docs: generate markdown 2023-01-06 22:36:47 +01:00
plugin_inspect.md docs: update url scheme for reference docs 2024-02-20 21:38:50 +01:00
plugin_install.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
plugin_ls.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
plugin_push.md docs: regenerate markdown 2024-02-21 10:40:13 +01:00
plugin_rm.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
plugin_set.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
plugin_upgrade.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
port.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
ps.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
pull.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
push.md push: Improve note message and colors 2024-07-10 11:36:40 +02:00
rename.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
restart.md cli/command/container: stop, restart: rename "--time" to "--timeout" 2024-09-30 09:43:54 +02:00
rm.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
rmi.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
run.md run: flag to include the Docker API socket 2025-04-15 10:57:44 -07:00
save.md image/save: Add `--platform` 2024-10-10 16:35:03 +02:00
search.md docs/reference: search: remove mention of deprecated "IsAutomated" 2025-03-31 17:45:20 +02:00
secret.md docs: generate markdown 2023-01-06 22:36:47 +01:00
secret_create.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
secret_inspect.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
secret_ls.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
secret_rm.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
service.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
service_create.md docs: update example redis tags from 3.0.x to 7.4.x 2024-11-05 11:20:17 +01:00
service_inspect.md docs: update example redis tags from 3.0.x to 7.4.x 2024-11-05 11:20:17 +01:00
service_logs.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
service_ls.md docs: update example redis tags from 3.0.x to 7.4.x 2024-11-05 11:20:17 +01:00
service_ps.md docs: update example redis tags from 3.0.x to 7.4.x 2024-11-05 11:20:17 +01:00
service_rm.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
service_rollback.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
service_scale.md docs: update example redis tags from 3.0.x to 7.4.x 2024-11-05 11:20:17 +01:00
service_update.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
stack.md docs: generate markdown 2023-01-06 22:36:47 +01:00
stack_config.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
stack_deploy.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
stack_ls.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
stack_ps.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
stack_rm.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
stack_services.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
start.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
stats.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
stop.md cli/command/container: stop, restart: rename "--time" to "--timeout" 2024-09-30 09:43:54 +02:00
swarm.md docs: generate markdown 2023-01-06 22:36:47 +01:00
swarm_ca.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
swarm_init.md Fix missing link from Configure node healthcheck heading 2025-02-19 16:56:28 +01:00
swarm_join-token.md docs: fix missing anchors in swarm reference pages 2025-02-21 23:46:07 +01:00
swarm_join.md docs: fix missing anchors in swarm reference pages 2025-02-21 23:46:07 +01:00
swarm_leave.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
swarm_unlock-key.md docs: fix missing anchors in swarm reference pages 2025-02-21 23:46:07 +01:00
swarm_unlock.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
swarm_update.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
system.md update cli-docs-tool to v0.6.0 2023-08-28 01:58:58 +02:00
system_df.md docs: use gh alert syntax for callouts 2024-08-16 11:02:10 +02:00
system_dial-stdio.md docs: generate markdown 2023-01-06 22:36:47 +01:00
system_events.md docs: corrected the max events returned 2024-10-16 12:21:51 +02:00
system_info.md docs: add documentation for CDI 2024-01-18 14:58:43 +01:00
system_prune.md docs: Link supported Go duration strings 2024-10-07 10:37:00 +02:00
tag.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
top.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
trust.md docs: generate markdown 2023-01-06 22:36:47 +01:00
trust_inspect.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
trust_key.md docs: generate markdown 2023-01-06 22:36:47 +01:00
trust_key_generate.md docs: minor editorial improvements, typo fixes 2023-12-19 17:15:38 +01:00
trust_key_load.md docs: minor editorial improvements, typo fixes 2023-12-19 17:15:38 +01:00
trust_revoke.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
trust_sign.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
trust_signer.md docs: generate markdown 2023-01-06 22:36:47 +01:00
trust_signer_add.md docs: minor editorial improvements, typo fixes 2023-12-19 17:15:38 +01:00
trust_signer_remove.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
unpause.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
update.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00
version.md chore: update link to docker engine api reference 2024-08-20 12:35:04 +02:00
volume.md Update docs/command output for volume pruning 2023-08-12 14:22:23 +01:00
volume_create.md Correct typos in docs/ and man/ 2024-06-06 02:15:23 +00:00
volume_inspect.md docs/reference: update links to Go documentation 2023-08-25 14:10:40 +02:00
volume_ls.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
volume_prune.md chore: regenerate docs 2024-07-04 10:30:56 +02:00
volume_rm.md cli/command/volume: remove example and var for long description 2025-02-03 12:21:00 +01:00
volume_update.md docs: generate markdown 2023-01-06 22:36:47 +01:00
wait.md docs: regenerate stubs for non-canonical commands 2024-01-15 13:49:53 +01:00