1) I am following the steps in generating the docker development image in R; however, it seems the volume is not synchronized between the docker container and my host machine. Do you have any idea?

This question is related to Setting Up A Reproducible Environment. The problem can happen in the case of using a different username and volume mount path. Make sure that the three shown users are the same values.

docker run -it --rm \
-p 8787:8787 \
-e USER= --> user <-- \

This is mainly happening because the new docker container (possibly run on Ubuntu) is trying to use the .dll cache file that is generated with another system. To resolve this issue, run the following command:
devtools::clean_dll()