Skip to content

Commit b476e50

Browse files
authored
Merge pull request #3229 from fir4tozden/fix/some-fixes-in-dockerSafeExec
fix: some fixes in dockerSafeExec()
2 parents 1b22384 + 5d42737 commit b476e50

File tree

1 file changed

+6
-5
lines changed
  • packages/server/src/utils/docker

1 file changed

+6
-5
lines changed

packages/server/src/utils/docker/utils.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,17 +146,17 @@ export const getContainerByName = (name: string): Promise<ContainerInfo> => {
146146
};
147147

148148
/**
149-
* Docker commands passed through this method are held during Docker's build or pull process.
149+
* Docker commands sent using this method are held in a hold when Docker is busy.
150150
*
151151
* https://github.com/Dokploy/dokploy/pull/3064
152-
* https://github.com/fir4tozden
153152
*/
154-
export const dockerSafeExec = (exec: string) => `CHECK_INTERVAL=10
153+
export const dockerSafeExec = (exec: string) => `
154+
CHECK_INTERVAL=10
155155
156156
echo "Preparing for execution..."
157157
158158
while true; do
159-
PROCESSES=$(ps aux | grep -E "docker build|docker pull" | grep -v grep)
159+
PROCESSES=$(ps aux | grep -E "^.*docker [A-Za-z]" | grep -v grep)
160160
161161
if [ -z "$PROCESSES" ]; then
162162
echo "Docker is idle. Starting execution..."
@@ -169,7 +169,8 @@ done
169169
170170
${exec}
171171
172-
echo "Execution completed."`;
172+
echo "Execution completed."
173+
`;
173174

174175
const cleanupCommands = {
175176
containers: "docker container prune --force",

0 commit comments

Comments
 (0)