I'm running rsync through a script, but I'm not getting the progress bar. It works fine when I run it directly, but when I run the script, I only get the echoes.
In my docker-compose.yml
:
command: /home/node/build-dir/command.sh
tty : true # Show output with syntax highlighting support.
#!/bin/ash
# First check if the directory is empty, as it is when it is mounted for the first time.
if [ -z "$(ls -A /home/node/work-dir/node_modules)" ]
then
echo 'Beginning to copy node_modules folder...'
# Recursively copy all files of build directory to that of the working directory.
rsync -ah --info=progress2 /home/node/build-dir/node_modules /home/node/work-dir/node_modules
echo 'Finished copying node_modules folder...'
else
echo 'The folder "node_modules" already exists; skipping copying.'
fi
# Run npm start command to start development.
exec npm start
I want it to show the progress and then stop when it finishes, finishing the script run. I want it to be as if when I run it directly through the shell using docker exec -it my_app ash
and then running the following:
rsync -ah --info=progress2 /home/node/build-dir/node_modules /home/node/work-dir/node_modules
So far, I get nothing, as in it acts the same as cp. I get the two echos "Beginning to copy..." and "Finished copying..." and that's it. Where's the progress?
- I tried to run the command through the shell on my host with test files and it worked.
- I tried to run the script through the shell on my host with test files and it worked.
- I tried to run the command through the shell from within the container and it worked.
- I tried to run the script through the shell from within the container and it worked.
My only assumption is that I've done something wrong with my docker-compose.yml
file.