snippetbashTip
docker context — Switch between contexts to manage multiple Docker environments. More information: <https://docs.dock
Viewed 0 times
commandbetweenmultiplecontextsclimanagedocker contextswitch
Problem
How to use the
docker context command: Switch between contexts to manage multiple Docker environments. More information: <https://docs.docker.com/reference/cli/docker/context/>.Solution
docker context — Switch between contexts to manage multiple Docker environments. More information: <https://docs.docker.com/reference/cli/docker/context/>.Create a context using a specific Docker endpoint:
docker context create {{context_name}} --docker "host={{tcp://remote-host:2375}}"Create a context based on the
$DOCKER_HOST environment variable:docker context create {{context_name}}Switch to a context:
docker context use {{context_name}}List all contexts:
docker context lsCode Snippets
Create a context using a specific Docker endpoint
docker context create {{context_name}} --docker "host={{tcp://remote-host:2375}}"Create a context based on the `$DOCKER_HOST` environment variable
docker context create {{context_name}}Switch to a context
docker context use {{context_name}}List all contexts
docker context lsContext
tldr-pages: common/docker context
Revisions (0)
No revisions yet.