testcontainers 8.1.0 → 8.1.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docker/docker-client.js +14 -6
- package/package.json +1 -1
|
@@ -48,8 +48,8 @@ const getDockerClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
48
48
|
});
|
|
49
49
|
const createDockerodeOptions = (dockerConfig) => {
|
|
50
50
|
const dockerOptions = {};
|
|
51
|
-
if (dockerConfig.
|
|
52
|
-
dockerOptions.socketPath =
|
|
51
|
+
if (dockerConfig.socketPath) {
|
|
52
|
+
dockerOptions.socketPath = dockerConfig.socketPath;
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
55
|
dockerOptions.host = dockerConfig.uri;
|
|
@@ -61,13 +61,21 @@ const createDockerodeOptions = (dockerConfig) => {
|
|
|
61
61
|
}
|
|
62
62
|
return dockerOptions;
|
|
63
63
|
};
|
|
64
|
-
const isDockerDaemonReachable = (dockerode) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
+
const isDockerDaemonReachable = (dockerode) => __awaiter(void 0, void 0, void 0, function* () {
|
|
65
|
+
try {
|
|
66
|
+
const response = yield dockerode.ping();
|
|
67
|
+
return response.toString() === "OK";
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
logger_1.log.warn(`Docker daemon is not reachable: ${err}`);
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
65
74
|
class ConfigurationStrategy {
|
|
66
75
|
getDockerConfig() {
|
|
67
76
|
const { DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH } = process.env;
|
|
68
77
|
return {
|
|
69
78
|
uri: DOCKER_HOST,
|
|
70
|
-
isSocket: false,
|
|
71
79
|
ssl: DOCKER_TLS_VERIFY === "1" && DOCKER_CERT_PATH !== undefined
|
|
72
80
|
? {
|
|
73
81
|
ca: path_1.default.resolve(DOCKER_CERT_PATH, "ca.pem"),
|
|
@@ -88,7 +96,7 @@ class UnixSocketStrategy {
|
|
|
88
96
|
getDockerConfig() {
|
|
89
97
|
return {
|
|
90
98
|
uri: "unix:///var/run/docker.sock",
|
|
91
|
-
|
|
99
|
+
socketPath: "/var/run/docker.sock",
|
|
92
100
|
};
|
|
93
101
|
}
|
|
94
102
|
isApplicable() {
|
|
@@ -102,7 +110,7 @@ class NpipeSocketStrategy {
|
|
|
102
110
|
getDockerConfig() {
|
|
103
111
|
return {
|
|
104
112
|
uri: "npipe:////./pipe/docker_engine",
|
|
105
|
-
|
|
113
|
+
socketPath: "//./pipe/docker_engine",
|
|
106
114
|
};
|
|
107
115
|
}
|
|
108
116
|
isApplicable() {
|