我Dockerrun.aws.json看起來是這樣的:「的nginx代理」 泊塢窗圖像插座量沒有安裝
{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "docker-socket",
"host": {
"sourcePath": "/var/run/docker.sock"
}
}
],
"containerDefinitions": [
{
"name": "nginx",
"image": "nginx",
"environment": [
{
"name": "VIRTUAL_HOST",
"value": "demo.local"
}
],
"essential": true,
"memory": 128
},
{
"name": "nginx-proxy",
"image": "jwilder/nginx-proxy",
"essential": true,
"memory": 128,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80
}
],
"mountPoints": [
{
"sourceVolume": "docker-socket",
"containerPath": "/tmp/docker.sock",
"readOnly": true
}
]
}
]
}
在運行這個本地使用 「EB本地運行」 的結果:
ERROR: you need to share your Docker host socket with a volume at /tmp/docker.sock Typically you should run your jwilder/nginx-proxy with:
-v /var/run/docker.sock:/tmp/docker.sock:ro
See the documentation at http://git.io/vZaGJ
如果我進入我的碼頭機並運行:
docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock jwilder/nginx-proxy
它創建容器並正確安裝卷。
爲什麼上面的Dockerrun.aws.json配置沒有正確地掛載/var/run/docker.sock:/tmp/docker.sock卷?
如果我從docker-compose.yml運行相同的配置,它在本地工作正常。不過,我想用一個Dockerrun.aws.json部署此相同的配置彈性魔豆:
version: '2'
services:
nginx:
image: nginx
container_name: nginx
cpu_shares: 100
volumes:
- /var/www/html
environment:
- VIRTUAL_HOST=demo.local
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
cpu_shares: 100
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
我的地方安裝使用:
- 的VirtualBox 5.0.22 r108108
- 泊塢窗機版本0.7.0,建立a650a40
- EB CLI 3.7.7(Python的2.7.1)
方的問題:你還在使用VirtualBox和泊塢窗機? –
我當時發佈了這個問題,現在使用Kitematic/Docker for Mac。問題依然存在.. – StuR