-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker/v0.9) why is dockerode being inited with an iife
- Loading branch information
1 parent
f91d76a
commit 7611eb2
Showing
1 changed file
with
6 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |