Skip to content

Commit 38515a7

Browse files
authored
fix: missing docker while podman is configured (guacsec#446)
1 parent e5bb86c commit 38515a7

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/oci_image/utils.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function execSyft(imageRef, opts = {}) {
149149
function getSyftEnvs(dockerPath, podmanPath) {
150150
let path = null;
151151
if (dockerPath && podmanPath) {
152-
path = `${dockerPath}${File.pathSeparator}${podmanPath}`;
152+
path = `${dockerPath}${delimiter}${podmanPath}`;
153153
} else if (dockerPath) {
154154
path = dockerPath;
155155
} else if (podmanPath) {
@@ -302,7 +302,13 @@ function podmanGetVariant(opts = {}) {
302302
* @returns {string} - The information
303303
*/
304304
function dockerPodmanInfo(dockerSupplier, podmanSupplier, opts = {}) {
305-
return dockerSupplier(opts) || podmanSupplier(opts);
305+
try {
306+
const result = dockerSupplier(opts);
307+
if (result) { return result; }
308+
} catch (_) {
309+
// docker not available, fall through to podman
310+
}
311+
return podmanSupplier(opts);
306312
}
307313

308314
/**

0 commit comments

Comments
 (0)