vmsan 0.1.0-alpha.26 → 0.1.0-alpha.27
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/dist/_chunks/context.mjs +15 -13
- package/package.json +1 -1
package/dist/_chunks/context.mjs
CHANGED
|
@@ -1774,18 +1774,11 @@ function buildImageRootfs(imageRef, cacheDir, minimal = false) {
|
|
|
1774
1774
|
const tarSizeOutput = execSync(`stat -c %s "${tmpTar}"`, { encoding: "utf-8" }).trim();
|
|
1775
1775
|
const tarMb = Number(tarSizeOutput) / 1024 / 1024;
|
|
1776
1776
|
const imageSizeMb = Math.max(1024, Math.ceil(tarMb + 512));
|
|
1777
|
-
|
|
1778
|
-
|
|
1777
|
+
const tmpExtract = join(cacheDir, "rootfs-extracted");
|
|
1778
|
+
mkdirSync(tmpExtract, { recursive: true });
|
|
1779
|
+
execSync(`tar -xf "${tmpTar}" -C "${tmpExtract}"`, { stdio: "pipe" });
|
|
1780
|
+
execSync(`mkfs.ext4 -q -d "${tmpExtract}" "${ext4Path}" "${imageSizeMb}M"`, { stdio: "pipe" });
|
|
1779
1781
|
execSync(`tune2fs -m 0 "${ext4Path}"`, { stdio: "pipe" });
|
|
1780
|
-
const tmpMount = join(cacheDir, "mnt");
|
|
1781
|
-
mkdirSync(tmpMount, { recursive: true });
|
|
1782
|
-
execSync(`mount -o loop "${ext4Path}" "${tmpMount}"`, { stdio: "pipe" });
|
|
1783
|
-
try {
|
|
1784
|
-
execSync(`tar -xf "${tmpTar}" -C "${tmpMount}"`, { stdio: "pipe" });
|
|
1785
|
-
} finally {
|
|
1786
|
-
execSync(`umount "${tmpMount}"`, { stdio: "pipe" });
|
|
1787
|
-
execSync(`rm -rf "${tmpMount}"`, { stdio: "pipe" });
|
|
1788
|
-
}
|
|
1789
1782
|
writeFileSync(join(cacheDir, "metadata.json"), JSON.stringify({
|
|
1790
1783
|
image: imageRef.full,
|
|
1791
1784
|
builtAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1795,10 +1788,19 @@ function buildImageRootfs(imageRef, cacheDir, minimal = false) {
|
|
|
1795
1788
|
} finally {
|
|
1796
1789
|
try {
|
|
1797
1790
|
execSync(`docker rm -f "${containerName}" 2>/dev/null`, { stdio: "pipe" });
|
|
1798
|
-
} catch {
|
|
1791
|
+
} catch (err) {
|
|
1792
|
+
consola.debug(`Failed to remove docker container ${containerName}: ${toError(err).message}`);
|
|
1793
|
+
}
|
|
1799
1794
|
try {
|
|
1800
1795
|
execSync(`rm -f "${tmpTar}"`, { stdio: "pipe" });
|
|
1801
|
-
} catch {
|
|
1796
|
+
} catch (err) {
|
|
1797
|
+
consola.debug(`Failed to remove temp tar ${tmpTar}: ${toError(err).message}`);
|
|
1798
|
+
}
|
|
1799
|
+
try {
|
|
1800
|
+
execSync(`rm -rf "${join(cacheDir, "rootfs-extracted")}"`, { stdio: "pipe" });
|
|
1801
|
+
} catch (err) {
|
|
1802
|
+
consola.debug(`Failed to remove extraction dir: ${toError(err).message}`);
|
|
1803
|
+
}
|
|
1802
1804
|
}
|
|
1803
1805
|
}
|
|
1804
1806
|
function resolveImageRootfs(imageRef, registryDir, minimal = false) {
|
package/package.json
CHANGED