Files copied out by sudo docker cp ... are owned by root and not the calling user.
Update the build-docker.sh to use tar streaming mode instead. As the receiving tar command is executed outside Docker the resulting directories & files are owned by the calling user. Hence you no longer need to use sudo rm -rf deploy to remove it.
Files copied out by
sudo docker cp ...
are owned byroot
and not the calling user.Update the
build-docker.sh
to use tar streaming mode instead. As the receivingtar
command is executed outside Docker the resulting directories & files are owned by the calling user. Hence you no longer need to usesudo rm -rf deploy
to remove it.