Hi,
I’m using Docker version 28.0.4, build b8034c0 on Ubuntu 22 lts. I have my image done and working and now I’m trying to rsync from the image to a server. I do this twice, from local-one to remote-one and again from local-two to remote-two. Syncing from local-one to remote-one always works, but syncing from local-two to remote-two fails with an rsync error. I only get this error within the image as part of ci-cd with gitlab. So could be docker, could be rsync, might even be gitlab(but probably not). All gitlab does is run a script in the image.
This works:
rsync -avz --delete --exclude-from="./exclude-one.txt" -e "ssh -oStrictHostKeyChecking=no -i /path/to/key.ppk" --progress /local-one/ user@server.com:/remote-one
This does not:
rsync -avz --delete --exclude-from="./exclude-two.txt" -e "ssh -oStrictHostKeyChecking=no -i /path/to/key.ppk" --progress /local-two/ user@server.com:/remote-two
The error:
rsync: [client] failed to open exclude file "./exclude-two.txt": No such file or directory (2)
rsync error: error in file IO (code 11) at exclude.c(1482) [client=3.2.7]
At first glance, it looks like the file is missing, except that immediately before the rsync and immediately after the rsync I cat the file. In the output of the script I can see the contents of the file and it is correct.
If I do docker run -ts myimage:tag
and copy and paste each command from the script to the command line. everything runs just fine. There’s no io error. It’s only within the docker image running w/in gitlab.
Has anyone run into something similar before?