お世話になっております。
現在、Dockerで環境構築を進めております。
以下の環境にしたいのですが、docker-compose upでエラーにつまづいており、
お知恵を頂きたく存じます。
*以下に記載するymlファイル等には内容にバージョン指定がないものもございますが、
取り急ぎバージョンは問わず一旦必要な技術構成だけ作ってしまい動作確認しようと
思い試行錯誤している状態です。
<技術>
・PHP7.3
・Laravel 5.8
・MySQL 8.0
・Nginx
・PHP-FPM
<つまづいている事>
docker-compose upすると、以下のエラーが発生してしまいます。
acount:docker-compose up Starting testdoc_nginx_1 ... error ERROR: for testdoc_nginx_1 Cannot start service nginx: b'OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/homma/Desktop/testDoc/etc/nginx/conf.d/default.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/7d6caf3be9062b57f3db3bf36eeba1a4a7c66979a4f0dea0a1311523f5818e75/merged\\\" at \\\"/var/lib/docker/overlay2/7d6caf3be9062b57f3db3bf36eeba1a4a7c66979a4f0dea0a1311523f5818e75/merged/etc/nginx/conf.d/default.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type' ERROR: for nginx Cannot start service nginx: b'OCI runtime create failed: container_linux.go:344: starting container process caused "process_linux.go:424: container init caused \"rootfs_linux.go:58: mounting \\\"/Users/homma/Desktop/testDoc/etc/nginx/conf.d/default.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/7d6caf3be9062b57f3db3bf36eeba1a4a7c66979a4f0dea0a1311523f5818e75/merged\\\" at \\\"/var/lib/docker/overlay2/7d6caf3be9062b57f3db3bf36eeba1a4a7c66979a4f0dea0a1311523f5818e75/merged/etc/nginx/conf.d/default.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type' ERROR: Encountered errors while bringing up the project.
<構成>
Project/ ┣ laravel/ ┣ mysql/ ┣ etc/ ┣ nginx ┣ .htpasswd ┣ conf.d ┣ default.conf └docker-compose.yml └.env └Dockerfile
<docker-compose.yml>
version: "2" services: nginx: image: nginx:alpine volumes: - ./etc/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf - ./etc/nginx/.htpasswd:/etc/nginx/.htpasswd - ./laravel/public:/var/www/laravel/public ports: - 80:80 links: - phpfpm depends_on: - phpfpm phpfpm: build: context: . dockerfile: ./Dockerfile volumes: - ./laravel:/var/www/laravel links: - mysql depends_on: - mysql env_file: .env mysql: image: mysql:5.7 env_file: .env volumes: - ./mysql/volumes:/var/lib/mysql ports: - 4306:3306
<Dockerfile>
FROM php:7.1-fpm-alpine RUN docker-php-ext-install pdo_mysql
情報に不足等ございましたらご指摘頂けますと幸いです。
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2019/08/01 07:16