Skip to content

Commit

Permalink
Fail 'fauna local' if docker is not running
Browse files Browse the repository at this point in the history
  • Loading branch information
ptpaterson committed Dec 30, 2024
1 parent 0514244 commit 1a7e68c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lib/docker-containers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@ export async function ensureContainerRunning({
color: _color,
}) {
color = _color;

// Check if the docker service is available before we point folks to Support
// for any issues later in the process.
const docker = container.resolve("docker");
try {
await docker.ping();
} catch (error) {
throw new CommandError(
`[StartContainer] Docker service is not available. Make sure that Docker is running.`,
{ cause: error },
);
}

if (pull) {
await pullImage(IMAGE_NAME);
}
Expand Down

0 comments on commit 1a7e68c

Please sign in to comment.