mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-20 02:58:53 +00:00
chore: renamed dockerSafeExec
This commit is contained in:
@@ -146,7 +146,7 @@ export const getContainerByName = (name: string): Promise<ContainerInfo> => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Commands passed through this method are held during Docker's build or pull process. (https://github.com/dokploy/dokploy/pull/3064)
|
// Commands passed through this method are held during Docker's build or pull process. (https://github.com/dokploy/dokploy/pull/3064)
|
||||||
export const createDockerSafeExec = (command: string) => `CHECK_INTERVAL=10
|
export const dockerSafeExec = (command: string) => `CHECK_INTERVAL=10
|
||||||
|
|
||||||
echo "Starting Docker cleanup..."
|
echo "Starting Docker cleanup..."
|
||||||
|
|
||||||
@@ -170,9 +170,9 @@ export const cleanUpUnusedImages = async (serverId?: string) => {
|
|||||||
try {
|
try {
|
||||||
const command = "docker image prune --all --force";
|
const command = "docker image prune --all --force";
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, createDockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else {
|
} else {
|
||||||
await execAsync(createDockerSafeExec(command));
|
await execAsync(dockerSafeExec(command));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -184,9 +184,9 @@ export const cleanStoppedContainers = async (serverId?: string) => {
|
|||||||
try {
|
try {
|
||||||
const command = "docker container prune --force";
|
const command = "docker container prune --force";
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, createDockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else {
|
} else {
|
||||||
await execAsync(createDockerSafeExec(command));
|
await execAsync(dockerSafeExec(command));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -198,9 +198,9 @@ export const cleanUpUnusedVolumes = async (serverId?: string) => {
|
|||||||
try {
|
try {
|
||||||
const command = "docker volume prune --all --force";
|
const command = "docker volume prune --all --force";
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, createDockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else {
|
} else {
|
||||||
await execAsync(createDockerSafeExec(command));
|
await execAsync(dockerSafeExec(command));
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -228,18 +228,18 @@ export const cleanUpInactiveContainers = async () => {
|
|||||||
export const cleanUpDockerBuilder = async (serverId?: string) => {
|
export const cleanUpDockerBuilder = async (serverId?: string) => {
|
||||||
const command = "docker builder prune --all --force";
|
const command = "docker builder prune --all --force";
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, createDockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else {
|
} else {
|
||||||
await execAsync(createDockerSafeExec(command));
|
await execAsync(dockerSafeExec(command));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const cleanUpSystemPrune = async (serverId?: string) => {
|
export const cleanUpSystemPrune = async (serverId?: string) => {
|
||||||
const command = "docker system prune --all --volumes --force";
|
const command = "docker system prune --all --volumes --force";
|
||||||
if (serverId) {
|
if (serverId) {
|
||||||
await execAsyncRemote(serverId, createDockerSafeExec(command));
|
await execAsyncRemote(serverId, dockerSafeExec(command));
|
||||||
} else {
|
} else {
|
||||||
await execAsync(createDockerSafeExec(command));
|
await execAsync(dockerSafeExec(command));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user