MCPcopy
hub / github.com/Dokploy/dokploy / pullImage

Function pullImage

packages/server/src/utils/docker/utils.ts:26–54  ·  view source on GitHub ↗
(
	dockerImage: string,
	onData?: (data: any) => void,
	authConfig?: Partial<RegistryAuth>,
)

Source from the content-addressed store, hash-verified

24}
25
26export const pullImage = async (
27 dockerImage: string,
28 onData?: (data: any) => void,
29 authConfig?: Partial<RegistryAuth>,
30): Promise<void> => {
31 try {
32 if (!dockerImage) {
33 throw new Error("Docker image not found");
34 }
35
36 if (authConfig?.username && authConfig?.password) {
37 await spawnAsync(
38 "docker",
39 [
40 "login",
41 authConfig.registryUrl || "",
42 "-u",
43 authConfig.username,
44 "-p",
45 authConfig.password,
46 ],
47 onData,
48 );
49 }
50 await spawnAsync("docker", ["pull", dockerImage], onData);
51 } catch (error) {
52 throw error;
53 }
54};
55
56export const pullRemoteImage = async (
57 dockerImage: string,

Callers 9

initializePostgresFunction · 0.90
setupWebMonitoringFunction · 0.90
initializeRedisFunction · 0.90
deployMySqlFunction · 0.90
deployMongoFunction · 0.90
deployRedisFunction · 0.90
deployLibsqlFunction · 0.90
deployPostgresFunction · 0.90
deployMariadbFunction · 0.90

Calls 1

spawnAsyncFunction · 0.90

Tested by

no test coverage detected