简体   繁体   English

使用 Laradock 运行 docker-compose up -d 后错误无法启动服务

[英]Error cannot start services after running docker-compose up -d using Laradock

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.我刚刚在 Mac OSX 10.13.6 High Sirra 上首次运行 docker docker-compose up -d nginx mysql redis来安装 docker。 It seems I看来我

WARNING: Image for service nginx was built because it did not already exist.警告:服务 nginx 的映像已构建,因为它尚不存在。 To rebuild this image you must use docker-compose build or docker-compose up --build .要重建此映像,您必须使用docker-compose builddocker-compose up --build Creating laradock_docker-in-docker_1 ... error Creating laradock_mysql_1 ... Creating laradock_workspace_1 ... Creating laradock_redis_1正在创建 laradock_docker-in-docker_1 ... 错误正在创建 laradock_mysql_1 ... 创建 laradock_workspace_1 ... 创建 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.'创建 laradock_mysql_1 ... 错误 X 并且 Docker 不知道。\\r\\n您可以从 Docker -> 首选项... -> 文件共享配置共享路径。\\r\\n请参阅https://docs.docker.com/docker -for-mac/osxfs/#namespaces了解更多信息。\\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.'错误:对于 laradock_mysql_1 无法启动服务 mysql:b'Mounts 被拒绝:\\r\\n路径 /Applications/MAMP/htdocs/community-messenger/laradock/mysql/docker-entrypoint-initdb.d\\r\\nisCreating laradock_workspace_1 ...错误fs/#namespaces 了解更多信息。\\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错误:对于 laradock_workspace_1 无法启动服务工作区:b'Mounts 被拒绝:\\r\\n路径 /Applications/MAMP/htdocs/community-messenger\\r\\n 未从 OS X 共享且 Docker 不知道。\\r\\n您可以配置共享路径从泊坞窗- >首选项... - >文件共享\\ r \\ n请查看https://docs.docker.com/docker-for-mac/osxfs/#namespaces 。更多信息\\ r \\ n.Creating laradock_redis_1 ... 完成

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.'错误:对于 docker-in-docker 无法启动服务 docker-in-docker:b'Mounts 被拒绝:\\r\\n路径 /Applications/MAMP/htdocs/community-messenger\\r\\nis 未从 OS X 共享且未知到 Docker。\\r\\n您可以从 Docker -> 首选项... -> 文件共享配置共享路径。\\r\\n有关更多信息,请参阅https://docs.docker.com/docker-for-mac/osxfs/#namespaces信息。\\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.'错误:对于 mysql 无法启动服务 mysql:b'Mounts 被拒绝:\\r\\n路径 /Applications/MAMP/htdocs/community-messenger/laradock/mysql/docker-entrypoint-initdb.d\\r\\n 未从 OS X 共享并且不为 Docker 所知。\\r\\n您可以从 Docker -> 首选项... -> 文件共享配置共享路径。\\r\\n请参阅https://docs.docker.com/docker-for-mac/osxfs/ #namespaces了解更多信息。\\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.'错误:对于工作区无法启动服务工作区:b'Mounts 被拒绝:\\r\\n路径 /Applications/MAMP/htdocs/community-messenger\\r\\n 未从 OS X 共享,Docker 不知道。\\r\\n您可以从 Docker -> 首选项... -> 文件共享配置共享路径。\\r\\n有关详细信息,请参阅https://docs.docker.com/docker-for-mac/osxfs/#namespaces。\\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.据我所知,它告诉我需要将/Applications/MAMP/htdocs/到 Docker > 首选项 > 文件共享。 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.我只使用/Applications/MAMP/htdocs/作为我习惯性地放置项目并且实际上并不启动或使用 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.我还发现我在后台运行 MySQL,所以我关闭它,重新启动 docker 并重新运行docker-compose up -d nginx mysql redis并出现类似的错误。

Edit编辑

I added /Applications/MAMP/htdocs/community-messenger to to Docker > Preferences > File Sharing and am now getting a new error:我将/Applications/MAMP/htdocs/community-messenger添加到 Docker > 首选项 > 文件共享,现在出现新错误:

Starting laradock_workspace_1 ... done Starting laradock_mysql_1 ... done Starting laradock_redis_1启动 laradock_workspace_1 ... 完成 启动 laradock_mysql_1 ... 完成 启动 laradock_redis_1
... done Starting laradock_docker-in-docker_1 ... done Creating laradock_php-fpm_1 ... done Creating laradock_nginx_1 ... 完成 启动 laradock_docker-in-docker_1 ... 完成 创建 laradock_php-fpm_1 ... 完成 创建 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)错误:对于 laradock_nginx_1 无法启动服务 nginx:驱动程序在端点 laradock_nginx_1 上编程外部连接失败(000b8e0f3a128f87e88d9faaff8b9dcf6d999e0a04a256763b8aef953eeebd35):启动用户空间代理时出错:000b8e0f3a128f87e88d9faaff8b9dcf6d999e0a04a256763b8aef953eeebd35):错误启动用户空间代理:000b8e0f3a128f87e88D

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.错误:对于 nginx 无法启动服务 nginx:驱动程序在端点 laradock_nginx_1 上编程外部连接失败(000b8e0f3a128f87e88d9faaff8b9dcf6d999e0a04a256763b8aef953eeebd35):启动用户区代理时出错:错误启动用户空间代理:.0 绑定项目错误:000b8e0f3a128f87e88d9faaff8b9dcf6d953eeebd35):错误启动用户空间代理:错误。0 绑定项目。0E040 错误:0 绑定错误。

When running docker-compose you just should have a docker-compose.yml file which defines which containers to run.运行docker-compose您应该有一个docker-compose.yml文件,该文件定义要运行的容器。 And you only have to type docker-compose up -d without specifying the containers again.并且您只需键入docker-compose up -d而无需再次指定容器。

Your other problem is that you have defined mappings which do not exist on your host OS (Mac OS).您的另一个问题是您定义了主机操作系统(Mac OS)上不存在的映射 You should either create them there, change the location or remove the mapping from your docker-compose.yml.您应该在那里创建它们,更改位置或从 docker-compose.yml 中删除映射。

I see you are using Laradock .我看到你正在使用Laradock As error said, you should go to "Docker -> Preferences... -> File Sharing" and share this path:正如错误所说,您应该转到“Doc​​ker -> Preferences... -> File Sharing”并共享此路径:

/Applications/MAMP/htdocs/community-messenger

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM