【Docker异常】docker-compose up throw UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 97: ordinal not in range(128)

 

一、异常

[root@VM_0_4_centos prometheus-grafana-linux]# docker-compose up
Traceback (most recent call last):
  File "/usr/bin/docker-compose", line 9, in <module>
    load_entry_point('docker-compose==1.18.0', 'console_scripts', 'docker-compose')()
  File "/usr/lib/python3.4/site-packages/compose/cli/main.py", line 71, in main
    command()
  File "/usr/lib/python3.4/site-packages/compose/cli/main.py", line 121, in perform_command
    project = project_from_options('.', options)
  File "/usr/lib/python3.4/site-packages/compose/cli/command.py", line 37, in project_from_options
    override_dir=options.get('--project-directory'),
  File "/usr/lib/python3.4/site-packages/compose/cli/command.py", line 87, in get_project
    config_details = config.find(project_dir, config_path, environment, override_dir)
  File "/usr/lib/python3.4/site-packages/compose/config/config.py", line 278, in find
    [ConfigFile.from_filename(f) for f in filenames],
  File "/usr/lib/python3.4/site-packages/compose/config/config.py", line 278, in <listcomp>
    [ConfigFile.from_filename(f) for f in filenames],
  File "/usr/lib/python3.4/site-packages/compose/config/config.py", line 178, in from_filename
    return cls(filename, load_yaml(filename))
  File "/usr/lib/python3.4/site-packages/compose/config/config.py", line 1305, in load_yaml
    return yaml.safe_load(fh)
  File "/usr/lib64/python3.4/site-packages/yaml/__init__.py", line 94, in safe_load
    return load(stream, SafeLoader)
  File "/usr/lib64/python3.4/site-packages/yaml/__init__.py", line 70, in load
    loader = Loader(stream)
  File "/usr/lib64/python3.4/site-packages/yaml/loader.py", line 24, in __init__
    Reader.__init__(self, stream)
  File "/usr/lib64/python3.4/site-packages/yaml/reader.py", line 85, in __init__
    self.determine_encoding()
  File "/usr/lib64/python3.4/site-packages/yaml/reader.py", line 124, in determine_encoding
    self.update_raw()
  File "/usr/lib64/python3.4/site-packages/yaml/reader.py", line 178, in update_raw
    data = self.stream.read(size)
  File "/usr/lib64/python3.4/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe3 in position 97: ordinal not in range(128)

 

二、解决方案

docker-compose.yml文件去除中文符号就可以了

posted @ 2020-08-05 17:58  N!CE波  阅读(1037)  评论(0编辑  收藏  举报