mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Merge 6642941f62 into 2a89be6efc
This commit is contained in:
@@ -21,12 +21,13 @@ export const getDokployImageTag = () => {
|
||||
return process.env.RELEASE_TAG || "latest";
|
||||
};
|
||||
|
||||
export const getDokployImage = () => {
|
||||
return `dokploy/dokploy:${getDokployImageTag()}`;
|
||||
export const getDokployImage = (customImage?: string) => {
|
||||
return customImage || `dokploy/dokploy:${getDokployImageTag()}`;
|
||||
};
|
||||
|
||||
export const pullLatestRelease = async () => {
|
||||
const stream = await docker.pull(getDokployImage());
|
||||
export const pullRelease = async (customImage?: string) => {
|
||||
const imageToPull = getDokployImage(customImage);
|
||||
const stream = await docker.pull(imageToPull);
|
||||
await new Promise((resolve, reject) => {
|
||||
docker.modem.followProgress(stream, (err, res) =>
|
||||
err ? reject(err) : resolve(res),
|
||||
@@ -34,6 +35,17 @@ export const pullLatestRelease = async () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** Pulls a custom Docker image and returns whether it was successful */
|
||||
export const pullCustomImage = async (imageUrl: string): Promise<boolean> => {
|
||||
try {
|
||||
await pullRelease(imageUrl);
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error("Error pulling custom image:", error);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/** Returns Dokploy docker service image digest */
|
||||
export const getServiceImageDigest = async () => {
|
||||
const { stdout } = await execAsync(
|
||||
|
||||
Reference in New Issue
Block a user