Windows10でLaradockのセットアップ時にエラー「指定されたファイルが見つかりません。」「pywintypes.error: (2, ‘WaitNamedPipe’, ‘指定されたファイルが見つかりません。’) Failed to execute script docker-compose」が出た場合の対処

Docker Laradock Laravel PHP ツール フレームワーク プログラミング

こんばんは。村上@フリーランスエンジニアです。

午前4時に目が覚めてしまったのでLaradockを試してみようと思い、

サイトのマニュアルに沿ってコマンドを叩いていたらソッコーでエラーが出たので原因と対策をメモしておきます。

Laradock
Full PHP development environment for Docker.

Laradockのリポジトリをcloneし、.envファイルを作り、docker-composeをたたいた所でエラー。

>docker-compose up -d nginx mysql phpmyadmin redis workspace
Traceback (most recent call last):
File "docker-compose", line 6, in <module>
File "compose\cli\main.py", line 68, in main
File "compose\cli\main.py", line 121, in perform_command
File "compose\cli\main.py", line 938, in up
File "compose\project.py", line 417, in up
File "compose\project.py", line 646, in warn_for_swarm_mode
File "site-packages\docker\api\daemon.py", line 90, in info
File "site-packages\docker\utils\decorators.py", line 46, in inner
File "site-packages\docker\api\client.py", line 189, in _get
File "site-packages\requests\sessions.py", line 488, in get
File "site-packages\requests\sessions.py", line 475, in request
File "site-packages\requests\sessions.py", line 596, in send
File "site-packages\requests\adapters.py", line 423, in send
File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
File "httplib.py", line 1042, in request
File "httplib.py", line 1082, in _send_request
File "httplib.py", line 1038, in endheaders
File "httplib.py", line 882, in _send_output
File "httplib.py", line 844, in send
File "site-packages\docker\transport\npipeconn.py", line 31, in connect
File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
File "site-packages\docker\transport\npipesocket.py", line 50, in connect
pywintypes.error: (2, 'WaitNamedPipe', '\x8ew\x92\xe8\x82\xb3\x82\xea\x82\xbd\x83t\x83@\x83C\x83\x8b\x82\xaa\x8c\xa9\x82\xc2\x82\xa9\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B')
Failed to execute script docker-compose

‘\x8ew\x92\xe8\x82\xb3\x82\xea\x82\xbd\x83t\x83@\x83C\x83\x8b\x82\xaa\x8c\xa9\x82\xc2\x82\xa9\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B’ は読めるように変換すると、

「指定されたファイルが見つかりません。」

となっています。

原因は、ローカルのDockerサービスが起動していないだけでした…しばらくDocker使ってなかったから忘れてた。

Docker for Windowsを起動しておきます。

Docker起動後、再度試したらうまくいきました。

>docker-compose up -d nginx mysql phpmyadmin redis workspace
Creating network "laradock_default" with the default driver
Creating network "laradock_frontend" with driver "bridge"
Creating network "laradock_backend" with driver "bridge"
Creating volume "laradock_phpmyadmin" with local driver
Creating volume "laradock_rethinkdb" with local driver
Creating volume "laradock_postgres" with local driver
Creating volume "laradock_aerospike" with local driver
Creating volume "laradock_redis" with local driver
Creating volume "laradock_minio" with local driver
Creating volume "laradock_caddy" with local driver
Creating volume "laradock_adminer" with local driver
Creating volume "laradock_elasticsearch" with local driver
Creating volume "laradock_mysql" with local driver
Creating volume "laradock_neo4j" with local driver
Creating volume "laradock_mariadb" with local driver
Creating volume "laradock_memcached" with local driver
Creating volume "laradock_mssql" with local driver
Creating volume "laradock_percona" with local driver
Creating volume "laradock_mongo" with local driver
Building redis
Step 1/5 : FROM redis:latest
latest: Pulling from library/redis
a5a6f2f73cd8: Pull complete
a6d0f7688756: Pull complete
53e16f6135a5: Pull complete
78a675d939ba: Pull complete
91255f6fabf6: Pull complete
4ea832befeee: Pull complete
Digest: sha256:19f4621c085cb7df955f30616e7bf573e508924cff515027c1dd041f152bb1b6
Status: Downloaded newer image for redis:latest
---> c188f257942c
Step 2/5 : LABEL maintainer "Mahmoud Zalt <mahmoud@zalt.me>"
---> Running in b5ac21edcd7f
---> 80af2c52caa6
Removing intermediate container b5ac21edcd7f
Step 3/5 : VOLUME /data
---> Running in dd359de21723
---> 57aa0582c449
Removing intermediate container dd359de21723
Step 4/5 : EXPOSE 6379
---> Running in 00823d3f5f34
---> 62595270dcaf
Removing intermediate container 00823d3f5f34
Step 5/5 : CMD redis-server
---> Running in 3e03bbc3d0de
---> ed148a3db695
Removing intermediate container 3e03bbc3d0de
Successfully built ed148a3db695
Successfully tagged laradock_redis:latest
WARNING: Image for service redis was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Building mysql
Step 1/9 : ARG MYSQL_VERSION=latest
--->
Step 2/9 : FROM mysql:${MYSQL_VERSION}
latest: Pulling from library/mysql
a5a6f2f73cd8: Already exists
936836019e67: Pull complete
283fa4c95fb4: Pull complete
1f212fb371f9: Pull complete
e2ae0d063e89: Pull complete
5ed0ae805b65: Pull complete
0283dc49ef4e: Pull complete
a7e1170b4fdb: Pull complete
241282fa67c2: Download complete
b0fecf619210: Download complete
bebf9f901dcc: Download complete

ついでにWindowsログイン時に常にDockerサービスを起動するようにしておきます。

タスクバーのDockerのアイコンを右クリック→Settingsを選択。

「General」→「Start Docker when you log in」にチェックを入れておく。

以上です。

コメント/ピンバック

タイトルとURLをコピーしました