我想在码头经营码头。我正在AWS上运行第一个容器,任务定义包含"mountPoints“和”CentOS“,如下所述,其中包含CentOS 7映像。
"mountPoints": [
{
"readOnly": null,
"containerPath": "/usr/share/rec/screenrecordings",
"sourceVolume": "recording"
}
],
"volumes": [
{
"name": "recording",
"host": {
"sourcePath": "/recording"
}
}
]
当这个容器打开时,我正在安装“docker”,然后在其中运行新的容器,试图上传“kurento server”Ubuntu14.4映像(https://hub.docker.com/r/kurento/kurento-media-server/ )。
在Docker内部运行以下命令:
“docker run -h my-app --name my-app -d <ECR repo end point>/image:latest --privileged -v /usr/share/rec/myApp:/usr/share/myApp --rm=true”
对接者立即退出,代码0,在码头日志上没有错误。
用-安装:
“docker run -h my-app --name my-app -d <ECR repo end point>/image:latest --privileged --mount type=bind,source=/usr/share/rec/myApp ,target=/usr/share/myApp --rm=true”
容器正在运行,但未建立挂载(当运行“码头检查”时,“挂载”部分为空,当进入停靠器-the挂载目录时不存在)。
主机"/usr/share/rec/myApp“上的路径与容器路径"/usr/share/”一样存在。
码头版本:Docker版本17.09.0-ce,构建afdb6d4
我真的很感谢任何帮助和洞察力,如何使这一工作。
提前谢谢你。
发布于 2017-12-17 04:40:13
解决了问题!问题在于命令参数顺序,--挂载应该写在码头映像名之前.最后我得到了这样的命令:
docker run -d -h my-app --name my-app --mount type=bind,source=/usr/share/rec/myApp ,target=/usr/share/myApp <ECR repo end point>/image:latest --privileged --rm=true
https://stackoverflow.com/questions/47694805
复制相似问题