我编写了一个shell脚本来运行docker映像并提取容器ID。之后,我想将主机中的test.sh移到容器中。
# Run docker container in background with an image.
docker run -d --rm --name="mycontainer" $DOCKER_IMG_ID /bin/bash;
# Get container ID
CONTAINER_ID=`docker inspect --format='{{.Id}}' mycontainer`;
echo $CONTAINER_ID;
docker ps;
sudo docker cp test.sh $CONTAINER_ID:/home/test.sh;
但这给了我以下错误。
localhost.lai: tool$ sudo ./stereo_pipeline.sh 5f575246377e test1.tif test1.XML test2.tif test2.XML test_config.json output/
./stereo_pipeline.sh 5f575246377e test1.tif test1.XML test2.tif test2.XML test_config.json output/
c24cf3959feea68822b8f5733005ff5798db119ee806ec4f504751032af6aa63
c24cf3959feea68822b8f5733005ff5798db119ee806ec4f504751032af6aa63
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c24cf3959fee 5f575246377e "/bin/bash" 1 second ago Up Less than a second LiveEO_stereo_pipeline
2dbcfebe1a93 5f575246377e "/bin/bash" 3 minutes ago Up 3 minutes amazing_ishizaka
Error: No such container:path: c24cf3959feea68822b8f5733005ff5798db119ee806ec4f504751032af6aa63:/home
有人可以帮助我解决此错误吗?谢谢。