Skip to content

Commit

Permalink
fix(docker/v0.9) why is dockerode being inited with an iife
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Jul 19, 2024
1 parent f91d76a commit 7611eb2
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/lib/docker.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import Dockerode from "dockerode";
import { getConfig } from "./config";
const { docker: config } = getConfig();
const docker = new Dockerode(
(() => ({
socketPath: !config.type || config.type === "socket" ? config.socket || "/var/run/docker.sock" : undefined,
host: config.type === "http" ? config.host : undefined,
port: config.type === "http" ? config.port : undefined,
protocol: config.type === "http" ? "http" : undefined,
}))(),
);
const docker = new Dockerode({
socketPath: !config.type || config.type === "socket" ? config.socket || "/var/run/docker.sock" : undefined,
host: config.type === "http" ? config.host : undefined,
port: config.type === "http" ? config.port : undefined,
protocol: config.type === "http" ? "http" : undefined,
});
export default docker;

0 comments on commit 7611eb2

Please sign in to comment.