Skip to content

Commit 25fe4f1

Browse files
committed
Add logs to track if Docker was accessible (or why not)
1 parent d43e3f7 commit 25fe4f1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ export async function startDockerInterceptionServices(
6464
delete process.env.DOCKER_HOST;
6565
}
6666

67+
// Log if Docker was not available at proxy start, and why, for debugging later:
68+
(async () => { // Catch sync & async setup errors
69+
await new Docker().ping();
70+
console.log('Connected to Docker');
71+
})().catch((error) => {
72+
console.warn(`Docker not available: ${error.message}`);
73+
});
74+
6775
const networkMonitor = monitorDockerNetworkAliases(proxyPort);
6876

6977
ruleParameters[`docker-tunnel-proxy-${proxyPort}`] = async ({ hostname }: { hostname: any }) => {

0 commit comments

Comments
 (0)