在Elastic Beanstalk中,代码上传到S3存储桶,然后挂载到EC2实例中的/var/app/current
,因此所有卷都需要从那里获取。
所以我的Dockerrun.aws.json
看起来像这样:
"volumes": [
{
"host": {
"sourcePath": "/var/app/current/foo" // <<< problem lies here
},
"name": "foo"
}
由于此/var/app/current
事件,执行$ eb local run
失败,因为部署时本地计算机上的源路径为~/bar/foo
而不是/var/app/current/foo
。错误如下:
Mounts denied:
The path /var/app/current
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
鉴于我希望我的eb部署在本地和远程使用相同的配置文件,我应该如何克服这个问题?
堆栈: