Docker Cheat Sheet/Create a context

Create a named context that targets a specific Docker endpoint.

Section: Contexts and Trust

Create a context

bash
bash
docker context create prod --docker host=ssh://user@server
Explanation

Very convenient for operating remote engines over SSH.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Contexts and Trust
List contexts
List available Docker contexts.
OpenIn sheetbash1 tag match
Use a context
Switch the current Docker context.
OpenIn sheetbash1 tag match
Show Docker version
Display client and server version details.
Pull an image
Download an image from a registry.
Run a container
Create and start a new container.
Inspect a container
Show low-level JSON metadata for a container.