ERROR: Version in "./docker-compose.yml" is unsupported.

這個錯誤出現在按照Walle的docker安裝的時候,
文檔的網址:http://www.walle-web.io/docs/installation_docker.html
全部報錯

ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

文檔給的配置文件

version: '3.7'
services:
  web:
    image: alenx/walle-web:2.0
    container_name: walle-nginx
    hostname: nginx-web
    ports:
    # 如果宿主機80端口被佔用,可自行修改爲其他port(>=1024)
    # 0.0.0.0:要綁定的宿主機端口:docker容器內端口80
      - "80:80"
    links:
      - python
    depends_on:
      - python
    networks:
      - walle-net
    restart: always

  python:
    # 默認使用alenx/walle-python:2.0
    # maven工程使用alenx/walle-java:2.0; maven:3.6.0, jdk:1.8.0_181
    image: alenx/walle-python:2.0
    #    image: alenx/walle-java:2.0
    container_name: walle-python
    hostname: walle-python
    env_file:
      # walle.env需和docker-compose在同級目錄
      - walle.env
    command: bash -c "cd /opt/walle-web/ && /bin/bash admin.sh migration && python waller.py"
    expose:
      - "5000"
    volumes:
      - /tmp/walle/codebase/:/tmp/walle/codebase/
      - /tmp/walle/logs/:/opt/walle-web/logs/
      - /root/.ssh:/root/.ssh/
    links: 
      - db
    depends_on:
      - db
    networks:
      - walle-net
    restart: always

  db:
    image: mysql
    container_name: walle-mysql
    hostname: walle-mysql
    env_file:
      - walle.env
    command: --default-authentication-plugin=mysql_native_password
    ports:
      - "3306:3306"
    expose:
      - "3306"
    volumes:
      - /data/walle/mysql:/var/lib/mysql
    networks:
      - walle-net
    restart: always

networks:
  walle-net:
    driver: bridge

看了下docker的文檔,應該是docker-compose的版本太老了。卸掉老版本,重新裝

pip install docker-compose -i https://mirrors.aliyun.com/pypi/simple/

然後在.bashrc中增加

export PATH="/home/pikachu/.local/bin":$PATH

重新運行

docker-compose up -d && docker-compose logs -f

發現報錯

Traceback (most recent call last):
  File "/home/pikachu/.local/bin/docker-compose", line 7, in <module>
    from compose.cli.main import main
  File "/home/pikachu/.local/lib/python2.7/site-packages/compose/cli/main.py", line 17, in <module>
    import docker
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/__init__.py", line 2, in <module>
    from .api import APIClient
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/api/__init__.py", line 2, in <module>
    from .client import APIClient
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/api/client.py", line 10, in <module>
    from .build import BuildApiMixin
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/api/build.py", line 6, in <module>
    from .. import auth
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/auth.py", line 9, in <module>
    from .utils import config
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/utils/__init__.py", line 3, in <module>
    from .decorators import check_resource, minimum_version, update_headers
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/utils/decorators.py", line 4, in <module>
    from . import utils
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/utils/utils.py", line 13, in <module>
    from .. import tls
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/tls.py", line 5, in <module>
    from .transport import SSLAdapter
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/transport/__init__.py", line 3, in <module>
    from .ssladapter import SSLAdapter
  File "/home/pikachu/.local/lib/python2.7/site-packages/docker/transport/ssladapter.py", line 21, in <module>
    from backports.ssl_match_hostname import match_hostname
ImportError: No module named ssl_match_hostname
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章