0

I just ran docker-compose up -d nginx mysql redis to install docker for the first time on Mac OSX 10.13.6 High Sirra. It seems I

WARNING: Image for service nginx was built because it did not already exist. To rebuild this image you must use docker-compose build or docker-compose up --build. Creating laradock_docker-in-docker_1 ... error Creating laradock_mysql_1 ... Creating laradock_workspace_1 ... Creating laradock_redis_1
...

Creating laradock_mysql_1 ... error 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.'

ERROR: for laradock_mysql_1 Cannot start service mysql: b'Mounts denied: \r\nThe path /Applications/MAMP/htdocs/community-messenger/laradock/mysql/docker-entrypoint-initdb.d\r\nisCreating laradock_workspace_1 ... error fs/#namespaces for more info.\r\n.'

ERROR: for laradock_workspace_1 Cannot start service workspace: b'Mounts denied: \r\nThe path /Applications/MAMP/htdocs/community-messenger\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.Creating laradock_redis_1 ... done

ERROR: for docker-in-docker Cannot start service docker-in-docker: b'Mounts denied: \r\nThe path /Applications/MAMP/htdocs/community-messenger\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.'

ERROR: for mysql Cannot start service mysql: b'Mounts denied: \r\nThe path /Applications/MAMP/htdocs/community-messenger/laradock/mysql/docker-entrypoint-initdb.d\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.'

ERROR: for workspace Cannot start service workspace: b'Mounts denied: \r\nThe path /Applications/MAMP/htdocs/community-messenger\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.' ERROR: Encountered errors while bringing up the project.

From what I can gather it's telling me that I need to add /Applications/MAMP/htdocs/ to Docker > Preferences > File Sharing. I tried that an am still getting similar errors.

I only use /Applications/MAMP/htdocs/ as a place where I put my projects out of habit and don't actually start or use MAMP. Is it possible to solve this by just moving the file?

I also found out that I had MySQL running in the background, so I shut it off, restarted docker and reran docker-compose up -d nginx mysql redis with similar errors.

Edit

I added /Applications/MAMP/htdocs/community-messenger to to Docker > Preferences > File Sharing and am now getting a new error:

Starting laradock_workspace_1 ... done Starting laradock_mysql_1 ... done Starting laradock_redis_1
... done Starting laradock_docker-in-docker_1 ... done Creating laradock_php-fpm_1 ... done Creating laradock_nginx_1
... error

ERROR: for laradock_nginx_1 Cannot start service nginx: driver failed programming external connectivity on endpoint laradock_nginx_1 (000b8e0f3a128f87e88d9faaff8b9dcf6d999e0a04a256763b8aef953eeebd35): Error starting userland proxy: Bind for 0.0.0.0:443: unexpected error (Failure EADDRINUSE)

ERROR: for nginx Cannot start service nginx: driver failed programming external connectivity on endpoint laradock_nginx_1 (000b8e0f3a128f87e88d9faaff8b9dcf6d999e0a04a256763b8aef953eeebd35): Error starting userland proxy: Bind for 0.0.0.0:443: unexpected error (Failure EADDRINUSE) ERROR: Encountered errors while bringing up the project.

user3325126
  • 1,284
  • 4
  • 15
  • 36
  • 2
    I see you are using Laradock. As error said, you should go to "Docker -> Preferences... -> File Sharing" and share the folders required by Laradock. – Alejandro Nortes Oct 16 '18 at 08:56
  • >From what I can gather it's telling me that I need to add /Applications/MAMP/htdocs/ to Docker > Preferences > File Sharing. I tried that an am still getting similar errors. Is this what you mean? – user3325126 Oct 16 '18 at 09:00
  • 1
    Try with /Applications/MAMP/htdocs/community-messenger. If you paste your docker-compose I can send you a modified version that uses a named volume for MySQL. – Alejandro Nortes Oct 16 '18 at 09:13
  • Thanks for that. It looks like everything is starting, but now I'm getting a new error. I'll edit my question to reflect – user3325126 Oct 16 '18 at 09:22
  • @AlejandroNortes from what I can see it seems like something is running on the same port, but I have no idea what: https://github.com/laradock/laradock/issues/251 – user3325126 Oct 16 '18 at 09:28
  • 1
    @AlejandroNortes, seems like everything is up and running now after I ran `sudo nginx -s stop`. If you'd like to put the answer at the bottom so I can mark it as correct that would be great. – user3325126 Oct 16 '18 at 09:39

3 Answers3

1

I see you are using Laradock. As error said, you should go to "Docker -> Preferences... -> File Sharing" and share this path:

/Applications/MAMP/htdocs/community-messenger

Alejandro Nortes
  • 594
  • 5
  • 17
0

When running docker-compose you just should have a docker-compose.yml file which defines which containers to run. And you only have to type docker-compose up -d without specifying the containers again.

Your other problem is that you have defined mappings which do not exist on your host OS (Mac OS). You should either create them there, change the location or remove the mapping from your docker-compose.yml.

online Thomas
  • 8,864
  • 6
  • 44
  • 85
  • I just ran `docker-compose up -d` without specifying the containers again and it seems to be redownloading a whole lot of stuff. Is that normal? – user3325126 Oct 16 '18 at 09:01
  • If the containers you have specified in docker-compose.yml are not yet downloaded then yes. – online Thomas Oct 16 '18 at 09:02
  • Ah I see you use laradock. In that case my answer is wrong. – online Thomas Oct 16 '18 at 09:03
  • Thanks anyways. Do you know what I could do to solve this problem? – user3325126 Oct 16 '18 at 09:05
  • 1
    I prefer to adjust my docker-compose.yml file to only what I need, rather than download some laradock and only start specific containers. You also need to map your files etc correctly using relative paths. When you see how it's quite easy. – online Thomas Oct 16 '18 at 09:25
0

for my situation this worked:

docker-compose stop

// Stop and remove containers, networks, images, and volumes !!
docker-compose down

docker-compose up -d nginx mysql phpmyadmin redis workspace elasticsearch
Payam Khaninejad
  • 7,692
  • 6
  • 45
  • 55