MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / buildImage

Function buildImage

scripts/docker-hub-push.js:47–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45function exec(command, options = {}) {
46 try {
47 execSync(command, { stdio: 'inherit', ...options });
48 return true;
49 } catch (error) {
50 console.error(`Error executing: ${command}`);
51 console.error(error.message);
52 return false;
53 }
54}
55
56// Build the container image
57function buildImage() {
58 const runtimeLabel = containerRuntime.getRuntimeLabel();
59 console.log(`Building container image (${runtimeLabel})...`);
60 console.log(`Image: ${fullImageName}`);
61 console.log('');
62
63 // Podman fails to push images that still reference library/* base layers because
64 // Docker Hub requests multi-repository auth scopes (e.g. library/node:pull).
65 const runtime = containerRuntime.getRuntime();
66 const squashFlag = runtime.endsWith('podman') ? ' --squash-all' : '';
67 const buildCommand = `${runtime} build${squashFlag} -t ${fullImageName} .`;
68 if (!exec(buildCommand)) {

Callers 1

docker-hub-push.jsFile · 0.85

Calls 1

execFunction · 0.85

Tested by

no test coverage detected