Context Management - docker/cli

Docker Contexts

Docker contexts are a way to manage multiple Docker environments. They allow you to switch between different Docker hosts and registries with ease. With contexts, you can have different configurations for different environments, such as development, staging, and production.

The docker context command is used to manage contexts. Here are some examples of how to use it:

  • To list all contexts:
docker context ls
  • To create a new context:
docker context create my-context --docker host=tcp://my-docker-host:2375
  • To switch to a different context:
docker context use my-context
  • To delete a context:
docker context rm my-context