码迷,mamicode.com
首页 > 其他好文 > 详细

Docker-compose up时报错:

时间:2019-12-31 12:55:53      阅读:65      评论:0      收藏:0      [点我收藏+]

标签:its   出现   hello   restart   ber   ble   start   yml   res   

Docker-compose up时报错:

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
in "./docker-compose.yml", line 2, column 9

解决

出现这个错误的是因为yaml格式不正确,谷歌定义的yaml格式太严格了,每个冒号后面都必须带有空格

错误

version:"3"
services:
  web:   
    image: licerlee/friendlyhello:v1
    deploy:
      replicas:5
      resources:
        limits:
          cpus:"0.1"
          memory:50M
      restart_policy:
        condition: on-failure
    ports:
      - "80:80"
    networks:
      - webnet
networks:
  webnet:

正确

version: "3"
services:
  web:
   
    image: licerlee/friendlyhello:v1
    deploy:
      replicas: 5
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
      restart_policy:
        condition: on-failure
    ports:
      - "80:80"
    networks:
      - webnet
networks:
  webnet:

Docker-compose up时报错:

标签:its   出现   hello   restart   ber   ble   start   yml   res   

原文地址:https://www.cnblogs.com/pp8080/p/12123708.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!