Docker Community Forums

Share and learn in the Docker community.

Quickstart: Docker Compose and Rails description does not work!

docker

(Dabagab) #1

Hi all,

I am newbie in the Docker world, I spent my holiday to learn this docker (however it is much harder than Vagrant).
So I use Ubuntu 16.04, I installed successfully the docker and docker-compose.

I read this tutorial: Quickstart: Docker Compose and Rails
But this is not working… maybe the tutorial is not fine.

I have this 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

I got this error always:
$ 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’

Mmmm, okay, I read a lot of google result, and it seems I am in a troube, because I use Ubuntu. Unfortunately the highest version number of docker in Ubuntu it is only 1.5.2. (I tried download the 1.7.1 with curl, but 1.5.2 installed automatically.)

$ 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

Do you have any ideas, how can I run the rails based docker?
I cannot install the docker machine, because I use ubuntu and the installation always will be failed.

However my PHP docker-compose.yml is fine, because I can run it :slight_smile: But this rails tutorial is not good.