Skip to content

Commit 89eb428

Browse files
committed
Disable Docker when running in Windows container mode
1 parent 725679b commit 89eb428

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/interceptors/docker/docker-interception-services.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ export const isDockerAvailable = () => {
2727
if (dockerAvailableCache) return dockerAvailableCache;
2828
else {
2929
dockerAvailableCache = (async () => { // Catch sync & async setup errors
30-
await new Docker().ping()
30+
return new Docker().info();
3131
})()
32-
.then(() => true)
32+
.then((info: { OSType?: 'windows' | 'linux' }) => {
33+
if (info.OSType === 'windows') {
34+
// We don't support Windows containers yet (and I think they're very rarely
35+
// used anyway) so we treat Windows-mode Docker as unavailable:
36+
console.warn("Docker is running in Windows container mode - not supported");
37+
return false;
38+
} else {
39+
return true;
40+
}
41+
})
3342
.catch(() => false);
3443

3544
// Cache the resulting status for 3 seconds:

0 commit comments

Comments
 (0)