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

Function syncAuthToPodmanMachine

scripts/container-runtime.js:118–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

116}
117
118function syncAuthToPodmanMachine() {
119 if (!isPodmanOnWindows()) {
120 return true;
121 }
122
123 const authFile = getHostAuthFile();
124 if (!authFile) {
125 console.error('Error: Docker Hub credentials not found on Windows.');
126 console.error(`Log in locally, then retry push:`);
127 console.error(` podman login ${dockerHubRegistry()} -u <username> -p <access-token>`);
128 return false;
129 }
130
131 try {
132 runQuiet('machine ssh sudo mkdir -p /root/.config/containers');
133 run(`machine cp "${authFile}" podman-machine-default:/root/.config/containers/auth.json`);
134 return true;
135 } catch (error) {
136 console.error('Error: Failed to sync Docker Hub credentials into the Podman VM.');
137 console.error(error.message);
138 return false;
139 }
140}
141
142module.exports = {
143 commandExists,

Callers

nothing calls this directly

Calls 5

isPodmanOnWindowsFunction · 0.85
getHostAuthFileFunction · 0.85
dockerHubRegistryFunction · 0.85
runQuietFunction · 0.85
runFunction · 0.85

Tested by

no test coverage detected