Skip to content

Instantly share code, notes, and snippets.

@paulredmond
Created September 18, 2017 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulredmond/de59edf6a42b8c3fbf90711ca7535523 to your computer and use it in GitHub Desktop.
Save paulredmond/de59edf6a42b8c3fbf90711ca7535523 to your computer and use it in GitHub Desktop.
Adding a volume - a Docker Compose file for an example Laravel project
version: '3'
services:
app:
build:
context: .
dockerfile: .docker/Dockerfile
image: laravel-docker
ports:
- 8080:80
volumes:
- .:/srv/app
@rassloff
Copy link

docker-compose up
Removing laravel-docker_app_1
Recreating 71e74e7a42a5_laravel-docker_app_1 ... error

ERROR: for 71e74e7a42a5_laravel-docker_app_1 Cannot start service app: b'Mounts denied: \r\nThe path /Users/rossi/Docker/laravel-docker\r\nis not shared from OS X and is not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.'

what is the problem on this point. I have copied your code only.

@tpaksu
Copy link

tpaksu commented May 8, 2019

I think there's an error in this line:

dockerfile: .docker/Dockerfile

shouldn't it be:

dockerfile: .docker/php/Dockerfile

?

@tpaksu
Copy link

tpaksu commented May 8, 2019

Nope, you have a mistake in your file tree view, which I've used to duplicate, it has a php folder under .docker folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment