oven-sh/bun · error
Failed to run container
Error message
Failed to run container: ${inspect(result)} What it means
After a detached `docker run`, inspecting the returned container ID failed to yield a usable container; the full spawn result is included to diagnose why the run/inspect did not produce a running container.
Solutions
- Check the image URL and command in the spawn result
- Run the docker command manually to see the container error
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at scripts/docker.mjs:198 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/0ef0685ab9cb9d8a.
Report an issue: GitHub.
Appendix: source
Thrown at scripts/docker.mjs:198
const args = Object.entries(containerOptions)
.filter(([_, value]) => typeof value !== "undefined")
.map(([key, value]) => (typeof value === "boolean" ? `--${key}` : `--${key}=${value}`));
if (detach) {
args.push("--detach");
} else {
args.push("--tty", "--interactive");
}
const stdio = detach ? "pipe" : "inherit";
const result = await this.spawn($`run ${args} ${url} ${command}`, { stdio });
if (!detach) {
return;
}
const containerId = result.trim();
const container = await this.inspectContainer(containerId);
if (!container) {
throw new Error(`Failed to run container: ${inspect(result)}`);
}
return container;
},
/**
* @param {Platform} platform
* @returns {Promise<DockerImage>}
*/
async getBaseImage(platform) {
const { os, distro, release } = platform;
const dockerPlatform = this.getPlatform(platform);
let url;
if (os === "linux") {
if (distro === "debian" || distro === "ubuntu" || distro === "alpine") {
url = `docker.io/library/${distro}:${release}`;
} else if (distro === "amazonlinux") {
url = `public.ecr.aws/amazonlinux/amazonlinux:${release}`;View on GitHub (pinned to 8c5296ac45)