Build local image for updates in apptask

This commit is contained in:
Johannes Zellner
2026-01-27 20:41:26 +01:00
parent fd0d65b8ce
commit a7929e142f
4 changed files with 26 additions and 8 deletions
+11 -5
View File
@@ -221,6 +221,9 @@ async function downloadImage(manifest) {
// skip for relay app
if (manifest.id === constants.PROXY_APP_APPSTORE_ID) return;
// only download non-local images, local ones are built locally
if (manifest.dockerImage.indexOf('local/') === 0) return;
const info = await docker.info();
const [dfError, diskUsage] = await safe(df.file(info.DockerRootDir));
if (dfError) throw new BoxError(BoxError.FS_ERROR, `Error getting file system info: ${dfError.message}`);
@@ -346,11 +349,8 @@ async function installCommand(app, args, progressCallback) {
await dns.registerLocations([ { subdomain: app.subdomain, domain: app.domain }].concat(app.secondaryDomains).concat(app.redirectDomains).concat(app.aliasDomains), { overwriteDns }, progressCallback);
}
// only download non-local images, local ones are built after restore
if (app.manifest.dockerImage.indexOf('local/') !== 0) {
await progressCallback({ percent: 40, message: 'Downloading image' });
await downloadImage(app.manifest);
}
await progressCallback({ percent: 40, message: 'Downloading image' });
await downloadImage(app.manifest);
await progressCallback({ percent: 50, message: 'Creating app data directory' });
await createAppDir(app);
@@ -682,6 +682,12 @@ async function updateCommand(app, args, progressCallback) {
await progressCallback({ percent: 60, message: 'Updating addons' });
await services.setupAddons(app, updateConfig.manifest.addons);
// now we have the local package tarball, so lets build
if (app.manifest.dockerImage.indexOf('local/') === 0) {
await progressCallback({ percent: 65, message: 'Building image' });
await buildLocalImage(app);
}
await progressCallback({ percent: 70, message: 'Creating container' });
await createContainer(app);