【发布时间】:2016-05-09 17:21:38
【问题描述】:
我是 Docker 世界的新手,我用假期来学习这个 docker(不过它比 Vagrant 难多了)。 所以我使用的是 Ubuntu 16.04,我成功安装了 docker 和 docker-compose。
我阅读了本教程:Quickstart: Docker Compose and Rails 但这不起作用...也许教程不太好。
我有这个 docker-compose.yml:
db:
image: postgres
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/www/html
ports:
- "3000:3000"
depends_on:
- db
我总是收到这个错误:
$ docker-compose run web rails new . --force --database=postgresql --skip-bundle
ERROR: Validation failed in file './docker-compose.yml', reason(s):
Unsupported config option for 'web' service: 'depends_on'
嗯,好吧,我读了很多谷歌搜索结果,看来我很麻烦,因为我使用的是 Ubuntu。不幸的是,Ubuntu 中 docker 的最高版本号仅为 1.5.2。 (我尝试使用 curl 下载 1.7.1,但自动安装了 1.5.2。)
$ docker version
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Tue Apr 26 23:43:49 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Tue Apr 26 23:43:49 2016
OS/Arch: linux/amd64
您有什么想法,我该如何运行基于 Rails 的 docker? 我无法安装docker机器,因为我使用的是ubuntu,安装总是会失败。
但是我的 PHP docker-compose.yml 很好,因为我可以运行它 :slight_smile: 但是这个 rails 教程不好。
【问题讨论】:
标签: ruby-on-rails docker docker-compose