dank-ai 1.0.28 → 1.0.30
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/docker/manager.js +20 -31
- package/package.json +1 -1
package/lib/docker/manager.js
CHANGED
|
@@ -1149,21 +1149,14 @@ class DockerManager {
|
|
|
1149
1149
|
|
|
1150
1150
|
try {
|
|
1151
1151
|
const buildContext = await this.createAgentBuildContext(agent);
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
'--file', path.join(buildContext, 'Dockerfile'),
|
|
1161
|
-
'--load',
|
|
1162
|
-
...(options.rebuild || options.noCache ? ['--no-cache'] : []),
|
|
1163
|
-
buildContext
|
|
1164
|
-
].join(' ');
|
|
1165
|
-
|
|
1166
|
-
await this.runCommand(buildCommand, `Agent ${agent.name} build`);
|
|
1152
|
+
|
|
1153
|
+
const stream = await this.docker.buildImage(buildContext, {
|
|
1154
|
+
t: imageName,
|
|
1155
|
+
dockerfile: "Dockerfile",
|
|
1156
|
+
nocache: options.rebuild || options.noCache || false,
|
|
1157
|
+
});
|
|
1158
|
+
|
|
1159
|
+
await this.followBuildProgress(stream, `Agent ${agent.name} build`);
|
|
1167
1160
|
|
|
1168
1161
|
this.logger.info(`Agent image '${imageName}' built successfully`);
|
|
1169
1162
|
|
|
@@ -1221,21 +1214,17 @@ class DockerManager {
|
|
|
1221
1214
|
|
|
1222
1215
|
try {
|
|
1223
1216
|
const buildContext = await this.createAgentBuildContext(agent);
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
buildContext
|
|
1236
|
-
].join(' ');
|
|
1237
|
-
|
|
1238
|
-
await this.runCommand(buildCommand, `Production build for ${agent.name}`);
|
|
1217
|
+
|
|
1218
|
+
const stream = await this.docker.buildImage(buildContext, {
|
|
1219
|
+
t: imageName,
|
|
1220
|
+
dockerfile: "Dockerfile",
|
|
1221
|
+
nocache: force,
|
|
1222
|
+
});
|
|
1223
|
+
|
|
1224
|
+
await this.followBuildProgress(
|
|
1225
|
+
stream,
|
|
1226
|
+
`Production build for ${agent.name}`
|
|
1227
|
+
);
|
|
1239
1228
|
|
|
1240
1229
|
this.logger.info(`Production image '${imageName}' built successfully`);
|
|
1241
1230
|
|
|
@@ -1251,7 +1240,7 @@ class DockerManager {
|
|
|
1251
1240
|
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
1252
1241
|
try {
|
|
1253
1242
|
this.logger.info(`Pushing image to registry (attempt ${attempt}/${maxAttempts}): ${imageName}`);
|
|
1254
|
-
await this.runCommand(`${dockerCmd} push ${imageName}`, `Docker push ${imageName}`);
|
|
1243
|
+
await this.runCommand(`${dockerCmd} push "${imageName}"`, `Docker push ${imageName}`);
|
|
1255
1244
|
this.logger.info(`Successfully pushed image: ${imageName}`);
|
|
1256
1245
|
pushed = true;
|
|
1257
1246
|
break;
|