`; 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 compose exec

DescriptionExecute a command in a running container
Usagedocker compose exec [OPTIONS] SERVICE COMMAND [ARGS...]

Description

This is the equivalent of docker exec targeting a Compose service.

With this subcommand, you can run arbitrary commands in your services. Commands allocate a TTY by default, so you can use a command such as docker compose exec web sh to get an interactive prompt.

By default, Compose will enter container in interactive mode and allocate a TTY, while the equivalent docker exec command requires passing --interactive --tty flags to get the same behavior. Compose also support those two flags to offer a smooth migration between commands, whenever they are no-op by default. Still, interactive can be used to force disabling interactive mode (--interactive=false), typically when docker compose exec command is used inside a script.

Options

OptionDefaultDescription
-d, --detachDetached mode: Run command in the background
-e, --envSet environment variables
--indexIndex of the container if service has multiple replicas
-T, --no-ttytrueDisable pseudo-TTY allocation. By default 'docker compose exec' allocates a TTY.
--privilegedGive extended privileges to the process
-u, --userRun the command as this user
-w, --workdirPath to workdir directory for this command