Skip to content

Commit bea70ad

Browse files
committed
Correct coping of volumes
1 parent cffdc18 commit bea70ad

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Volumes listed in `iobBackup` are tagged for inclusion in ioBroker backup routin
180180
-->
181181

182182
## Changelog
183-
### 0.0.26 (2025-10-09)
183+
### **WORK IN PROGRESS**
184184
- (@GermanBluefox) Split the docker manager into pure docker commands and monitoring of own containers
185185

186186
### 0.0.3 (2025-09-25)

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ export default class DockerPlugin extends PluginBase {
203203
warn: this.log.warn.bind(this.log),
204204
error: this.log.error.bind(this.log),
205205
},
206+
adapterDir: this.settings.adapterDir,
206207
namespace: this.parentNamespace.replace('system.adapter.', '') as `${string}.${number}`,
207208
},
208209
this.#configurations,

src/lib/DockerManagerOfOwnContainers.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// it monitors periodically the docker daemon status.
33
// It manages containers defined in common.plugins.docker and could monitor other containers
44

5+
import { join } from 'path';
56
import type { ContainerConfig, ContainerStats, ContainerStatus, DockerContainerInspect } from '../types';
67
import DockerManager from './DockerManager';
78

@@ -255,6 +256,7 @@ export default class DockerManagerOfOwnContainers extends DockerManager {
255256
readonly #ownContainers: ContainerConfig[] = [];
256257
#monitoringInterval: NodeJS.Timeout | null = null;
257258
#ownContainersStats: { [name: string]: ContainerStatus } = {};
259+
#adapterDir: string;
258260

259261
constructor(
260262
options: {
@@ -266,12 +268,14 @@ export default class DockerManagerOfOwnContainers extends DockerManager {
266268
cert?: string;
267269
key?: string;
268270
};
271+
adapterDir?: string;
269272
logger: ioBroker.Logger;
270273
namespace: `${string}.${number}`;
271274
},
272275
containers?: ContainerConfig[],
273276
) {
274277
super(options);
278+
this.#adapterDir = options.adapterDir || '';
275279
this.#ownContainers = containers || [];
276280
this.#waitAllChecked = new Promise<void>(resolve => (this.#waitAllCheckedResolve = resolve));
277281
}
@@ -556,6 +560,14 @@ export default class DockerManagerOfOwnContainers extends DockerManager {
556560
}
557561
}
558562

563+
if (
564+
mount.iobAutoCopyFrom &&
565+
(!mount.iobAutoCopyFrom.startsWith('/') ||
566+
mount.iobAutoCopyFrom.match(/^[a-zA-Z]:/))
567+
) {
568+
mount.iobAutoCopyFrom = join(this.#adapterDir, mount.iobAutoCopyFrom);
569+
}
570+
559571
const volume = volumes.find(v => v.name === mount.source);
560572
if (!volume) {
561573
this.log.info(`Creating docker volume ${mount.source}`);

0 commit comments

Comments
 (0)