Find the result of this problem myself.
I build and commit this docker in one machine with root permission，and the Anaconda3 was installed in /root/anaconda3/bin. I then pulled and run this docker in another machine without root permission, in which the installation path can't be accessed. I thus got the "conda command not found" error.
To solve this problem, it seems that I have to ture to someone with root permission for help. Thank @David Maze anyway.
I built a docker container with anaconda and other packages. in the container, I used echo "export PATH="/root/anaconda3/bin:$PATH"" and ~/.bashrc and /bin/bash -c "source ~/.bashrc"", conda command worked fine, and the python version was correct.
however, when committed and pushed the container to the docker hub, and then pulled it elsewhere, it gave me "bash: conda: command not found" when i tried to use conda command.
Would anyone tell me how to solve this problem? Any advice or suggestion will be appreciated.
conda command not found in docker container after commit and push