-
Notifications
You must be signed in to change notification settings - Fork 254
config.json in container and 'Device or resource busy' #3837
Copy link
Copy link
Open
Description
Bug report information
Description
In docker-entrypoint.sh there is a command:
...
mv config.json.tmp config.json
...
It works fine as long as no-one wants to mount external config.json file (docker run -v $(pwd)/config.json:/usr/src/app/config.json ...).
If so "docker" fails with the error:
mv: cannot move 'config.json.tmp' to 'config.json': Device or resource busy
The reason is that Linux does not allow to delete/rename mount points (mv uses actually rename() syscall).
One of the possible solutions is to replace "mv" with 2 commands:
--- old/docker-entrypoint.sh 2021-08-31 07:47:00.832079384 +0000
+++ new/docker-entrypoint.sh 2021-08-31 07:47:30.516815669 +0000
@@ -197,7 +197,8 @@
if [[ $JQ_FILTERS_CONFIG != "." ]]; then
jq "$JQ_FILTERS_CONFIG" config.json > config.json.tmp
- mv config.json.tmp config.json
+ cp config.json.tmp config.json
+ rm config.json.tmp
fi
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels