`; resultsHTML += results .map((item) => { let excerpt = item.excerpt; if (excerpt.length > 200) { excerpt = excerpt.substring(0, 200); } return `
${item.meta.title}

…${excerpt}…

`; }) .join(""); if (resultsLength > 5) { resultsHTML += ``; } searchBarResults.innerHTML = resultsHTML; } } searchBarInput.addEventListener("input", search); if (window.heap !== undefined) { searchBarResults.addEventListener("click", function (event) { if (event.target.tagName === "A" && event.target.closest(".link")) { const searchQuery = event.target.getAttribute("data-query"); const resultIndex = event.target.getAttribute("data-index"); const url = new URL(event.target.href); const properties = { docs_search_target_path: url.pathname, docs_search_target_title: event.target.textContent, docs_search_query_text: searchQuery, docs_search_target_index: resultIndex, docs_search_source_path: window.location.pathname, docs_search_source_title: document.title, }; heap.track("Docs - Search - Click - Result Link", properties); } }); } });

docker context create

DescriptionCreate a context
Usagedocker context create [OPTIONS] CONTEXT

Description

Creates a new context. This lets you switch the daemon your docker CLI connects to.

Options

OptionDefaultDescription
--descriptionDescription of the context
--dockerset the docker endpoint
--fromcreate context from a named context

Examples

Create a context with a Docker endpoint (--docker)

Use the --docker flag to create a context with a custom endpoint. The following example creates a context named my-context with a docker endpoint of /var/run/docker.sock:

$ docker context create \
    --docker host=unix:///var/run/docker.sock \
    my-context

Create a context based on an existing context (--from)

Use the --from=<context-name> option to create a new context from an existing context. The example below creates a new context named my-context from the existing context existing-context:

$ docker context create --from existing-context my-context

If the --from option isn't set, the context is created from the current context:

$ docker context create my-context

This can be used to create a context out of an existing DOCKER_HOST based script:

$ source my-setup-script.sh
$ docker context create my-context

To source the docker endpoint configuration from an existing context use the --docker from=<context-name> option. The example below creates a new context named my-context using the docker endpoint configuration from the existing context existing-context:

$ docker context create \
    --docker from=existing-context \
    my-context

Docker endpoints configurations, as well as the description can be modified with docker context update.

Refer to the docker context update reference for details.