mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-07 20:45:17 +00:00
fix: some fixes in dockerSafeExec()
This commit is contained in:
@@ -146,17 +146,17 @@ export const getContainerByName = (name: string): Promise<ContainerInfo> => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Docker commands passed through this method are held during Docker's build or pull process.
|
* Docker commands sent using this method are held in a hold when Docker is busy.
|
||||||
*
|
*
|
||||||
* https://github.com/Dokploy/dokploy/pull/3064
|
* https://github.com/Dokploy/dokploy/pull/3064
|
||||||
* https://github.com/fir4tozden
|
|
||||||
*/
|
*/
|
||||||
export const dockerSafeExec = (exec: string) => `CHECK_INTERVAL=10
|
export const dockerSafeExec = (exec: string) => `
|
||||||
|
CHECK_INTERVAL=10
|
||||||
|
|
||||||
echo "Preparing for execution..."
|
echo "Preparing for execution..."
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
PROCESSES=$(ps aux | grep -E "docker build|docker pull" | grep -v grep)
|
PROCESSES=$(ps aux | grep -E "docker " | grep -v grep)
|
||||||
|
|
||||||
if [ -z "$PROCESSES" ]; then
|
if [ -z "$PROCESSES" ]; then
|
||||||
echo "Docker is idle. Starting execution..."
|
echo "Docker is idle. Starting execution..."
|
||||||
@@ -169,7 +169,8 @@ done
|
|||||||
|
|
||||||
${exec}
|
${exec}
|
||||||
|
|
||||||
echo "Execution completed."`;
|
echo "Execution completed."
|
||||||
|
`;
|
||||||
|
|
||||||
export const cleanupContainers = async (serverId?: string) => {
|
export const cleanupContainers = async (serverId?: string) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user