【发布时间】:2018-03-01 21:50:38
【问题描述】:
小测试用例:
docker-compose.yml
nginx:
image: nginx:1
ports:
- "80:80"
volumes:
- ./testconf:/etc/nginx/conf.d
- ./testhtml:/usr/share/nginx/html
testconf/nginx.conf
server {
listen 80;
server_name _;
location / {
root /usr/share/nginx/html;
try_files $uri $uri/;
}
}
testhtml/index.html
<!DOCTYPE html>
<html>
<body>
<p>Hello</p>
</body>
</html>
机器创建:
$ docker-machine create --driver digitalocean --digitalocean-access-token xxxx --digitalocean-region "ams3" edgee
推:
$ eval $(docker-machine env edgee)
$ docker-compose up
$ curl $(docker-machine ip edgee)
当我查看容器内部时,应该安装的文件不存在。这适用于本地,适用于机器和 virtualbox,但不适用于 digitalocean?
【问题讨论】:
标签: docker nginx docker-compose dockerfile docker-machine