linux – Docker构成构建错误

linux – Docker构成构建错误,第1张

概述如果我使用命令docker-compose build,我将得到如下错误: ERROR: Validation failed in file './docker-compose.yml', reason(s):Service 'php' configuration key 'expose' '0' is invalid: should be ofthe format 'PORT[/PROTOC 如果我使用命令docker-compose build,我将得到如下错误:

ERROR: ValIDation Failed in file './docker-compose.yml',reason(s):Service 'PHP' configuration key 'expose' '0' is invalID: should be ofthe format 'PORT[/PROTOCol]'

我使用最新版本的docker和docker-compose.

我的docker-compose.yml有下一个代码:

application:    build: code    volumes:        - ./symfony:/var/www/symfony        - ./logs/symfony:/var/www/symfony/app/logs    tty: truedb:    image: MysqL    ports:        - 3306:3306    environment:        MysqL_ROOT_PASSWORD: root        MysqL_DATABASE: symfony        MysqL_USER: root        MysqL_PASSWORD: rootPHP:    build: PHP-fpm    expose:        - 9000:9000    volumes_from:        - application    links:        - dbNginx:    build: Nginx    ports:        - 80:80    links:        - PHP    volumes_from:        - application    volumes:        - ./logs/Nginx/:/var/log/Nginxelk:    image: willdurand/elk    ports:        - 81:80    volumes:        - ./elk/logstash:/etc/logstash        - ./elk/logstash/patterns:/opt/logstash/patterns    volumes_from:        - application        - PHP        - Nginx

我使用的是ubuntu 14.04
你能告诉我怎么解决它?

解决方法 您需要将端口定义放在短端口(2位数)的引号中.这是YAML的性质和docker-compose中使用的解析器的结果.

application:    build: code    volumes:        - ./symfony:/var/www/symfony        - ./logs/symfony:/var/www/symfony/app/logs    tty: truedb:    image: MysqL    ports:        - "3306:3306"    environment:        MysqL_ROOT_PASSWORD: root        MysqL_DATABASE: symfony        MysqL_USER: root        MysqL_PASSWORD: rootPHP:    build: PHP-fpm    expose:        - "9000"    volumes_from:        - application    links:        - dbNginx:    build: Nginx    ports:        - "80:80"    links:        - PHP    volumes_from:        - application    volumes:        - ./logs/Nginx/:/var/log/Nginxelk:    image: willdurand/elk    ports:        - "81:80"    volumes:        - ./elk/logstash:/etc/logstash        - ./elk/logstash/patterns:/opt/logstash/patterns    volumes_from:        - application        - PHP        - Nginx

曝光语句也应仅包含一个数字,并且也应引用.在上面添加了所有必需的更改.

总结

以上是内存溢出为你收集整理的linux – Docker构成构建错误全部内容,希望文章能够帮你解决linux – Docker构成构建错误所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1018111.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存