MCPcopy
hub / github.com/coder/mux / postCreateSetup

Method postCreateSetup

src/node/runtime/DevcontainerRuntime.ts:528–559  ·  view source on GitHub ↗

* Build and start the devcontainer after workspace creation. * This runs `devcontainer up` which builds the image and starts the container.

(params: WorkspaceInitParams)

Source from the content-addressed store, hash-verified

526 * This runs `devcontainer up` which builds the image and starts the container.
527 */
528 async postCreateSetup(params: WorkspaceInitParams): Promise<void> {
529 const { workspacePath, initLogger, abortSignal, env } = params;
530
531 initLogger.logStep("Building devcontainer...");
532
533 this.lastCredentialEnv = env;
534 this.currentWorkspacePath = workspacePath;
535 this.refreshContainerRequirements(env);
536
537 try {
538 const result = await devcontainerUp({
539 workspaceFolder: workspacePath,
540 configPath: this.configPath,
541 initLogger,
542 abortSignal,
543 additionalMounts: this.containerMounts.length > 0 ? this.containerMounts : undefined,
544 remoteEnv: Object.keys(this.containerEnv).length > 0 ? this.containerEnv : undefined,
545 });
546
547 // Cache container info
548 this.remoteWorkspaceFolder = result.remoteWorkspaceFolder;
549 this.remoteUser = result.remoteUser;
550 this.currentWorkspacePath = workspacePath;
551 await this.fetchRemoteHome(abortSignal);
552
553 await this.setupCredentials(env, abortSignal);
554
555 initLogger.logStep("Devcontainer ready");
556 } catch (error) {
557 throw new Error(`Failed to start devcontainer: ${getErrorMessage(error)}`);
558 }
559 }
560
561 /**
562 * Run .mux/init hook inside the devcontainer.

Callers

nothing calls this directly

Calls 6

fetchRemoteHomeMethod · 0.95
setupCredentialsMethod · 0.95
devcontainerUpFunction · 0.90
getErrorMessageFunction · 0.90
logStepMethod · 0.80

Tested by

no test coverage detected