win10 配置laradock(docker)


报错信息:


```bash

PS G:\laradock> docker-compose exec —user=laradock laradock_workspace_1 bash

Traceback (most recent call last):

  File "docker-compose", line 3, in <module>

  File "compose\cli\main.py", line 68, in main

  File "compose\cli\main.py", line 118, in perform_command

  File "compose\cli\main.py", line 401, in exec_command

  File "compose\project.py", line 142, in get_service

  File "compose\project.py", line 630, in __init__

UnicodeDecodeError: 'ascii' codec can't decode byte 0xa1 in position 0: ordinal not in range(128)

Failed to execute script docker-compose

```


解决方法:

1. 删除docker自带的docker-compose

我本机安装在C:\Program Files\Docker\Docker\resources\bin下面。删除docker-compose.exe(如有环境变量也删除)。


2. 安装python3(自带pip)

以管理员身份打开命令行,安装1.13.0版本,不加则安装最新版本。

```bash

pip install docker-compose==1.13.0

```

3. 执行docker-compose up -d nginx 等命令报错:


```bash

....略

  File "c:\program files\python36\lib\site-packages\docker\api\client.py", line 129, in __init__

    'Install pypiwin32 package to enable npipe:// support'

docker.errors.DockerException: Install pypiwin32 package to enable npipe:// support

```

根据报错信息,要安装pypiwin32,继续执行命令


```bash

pip install pypiwin32 

```

ok!

perfect!

Install docker-compose in a Python 3 environment