@iobroker/js-controller-common 4.0.21 → 4.0.24
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/lib/common/tools.js +10 -0
- package/package.json +2 -2
package/lib/common/tools.js
CHANGED
|
@@ -351,6 +351,7 @@ function getMac(callback) {
|
|
|
351
351
|
*/
|
|
352
352
|
function isDocker() {
|
|
353
353
|
try {
|
|
354
|
+
// deprecated, works only with docker daemon
|
|
354
355
|
fs.statSync('/.dockerenv');
|
|
355
356
|
return true;
|
|
356
357
|
} catch {
|
|
@@ -359,6 +360,15 @@ function isDocker() {
|
|
|
359
360
|
|
|
360
361
|
try {
|
|
361
362
|
// check docker group
|
|
363
|
+
// ioBroker docker image specific, will be created during build process
|
|
364
|
+
fs.statSync('/opt/scripts/.docker_config/.thisisdocker');
|
|
365
|
+
return true;
|
|
366
|
+
} catch {
|
|
367
|
+
// ignore error
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
try {
|
|
371
|
+
// check docker group, works in most cases, but not on arm
|
|
362
372
|
return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
|
|
363
373
|
} catch {
|
|
364
374
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iobroker/js-controller-common",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.24",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=12.0.0"
|
|
6
6
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"lib/",
|
|
49
49
|
"index.js"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "5645debf3394177abeef58917f872a7d8c43e320"
|
|
52
52
|
}
|