Docker.github.io: Feedback for: compose/gettingstarted.md

Created on 6 Nov 2016  路  7Comments  路  Source: docker/docker.github.io

URL: https://docs.docker.com/compose/gettingstarted.md

The code in the article did not work for me. I got this error on Docker 1.12.1 on Windows 10:

web_1    | python: can't open file 'app.py': [Errno 2] No such file or directory

I had to remove the volume section from the yml which fixed it:

    version: '2'
    services:
      web:
        build: .
        ports:
         - "5000:5000"
        depends_on:
         - redis
      redis:
        image: redis

I would also recommend supplying a zip file with the whole thing so I could have just downloaded it instead of copy pasting which introduced indentation issues in app.py.

All 7 comments

Hi @ubershmekel ,
Thanks for the feedback, and I'm sorry you ran into problems with this. I tested the steps on my machine and got it to run per the docs with volumes. I suspect that in doing the cut-and-paste, the indentation got off in your files and is preventing this from running. (I did this in vi and had to remove extra leading spaces after the first line in the Compose file to make it look exactly like the example.)

Agreed, we should provide a zip in the docs or include this or an updated example in /docker/labs/ (best) and/or a note on the importance of keeping the indentation mapped to the example (at a minimum).

@nathanleclaire @dnephin @ManoMarks @johndmulhausen @mstanleyjones , any thoughts before I close this comment?

Thanks for the response @londoncalling

The past few days I've wrestled with volumes and after hours wasted I found the answer.

I don't know if all other platforms need to do this or not - but on Windows 10 I had to go to Docker -> Settings -> Shared Drives and share the drive where the dockerfile and volume will be. Otherwise volumes just don't work at all. You might want to mention that on the page as well.

I think @ubershmekel found it. For Linux containers on Windows using Windows 10 pro you have to make sure you share the drive. Not for Windows containers.

This is a common issue with Docker for Mac, and Docker Toolbox as well. If anyone tries to use volumes when their project is outside of the Users directory, they will get an error like above. I've answered quite a few stack overflow questions about this very issue.

Maybe we should mention that in the getting started guides.

@ubershmekel @ManoMarks @dnephin thanks you guys, I'll get a draft version of these details into the docs in a few places and have you all review it. More soon.

@ubershmekel issue is now addressed per docs in PR #587 , thanks again for the good feedback, and let me know if you have further comments on this

@londoncalling you're welcome and thank you for the fix. Looks great.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rvernica picture rvernica  路  3Comments

KantarBruceAdams picture KantarBruceAdams  路  4Comments

HariSekhon picture HariSekhon  路  3Comments

Bharathkumarraju picture Bharathkumarraju  路  3Comments

GPPassos picture GPPassos  路  3Comments