要將文件拷貝到Docker容器中,可以使用docker cp命令。
docker cp
例如,要將本地文件file.txt拷貝到名為container1的容器中的/path/to/destination目錄,可以使用以下命令:
file.txt
container1
/path/to/destination
docker cp file.txt container1:/path/to/destination
這將把file.txt文件拷貝到container1容器中的/path/to/destination目錄中。