我正在尝试使用postgres dockerise我的rails应用程序。我遵循了几个在线tutoarials,但我遇到了很多麻烦。docker-compse构建错误 - 不受支持的版本
我也是落后企业代理其犯规帮助
我可以泊坞窗泊坞窗建立--build_args并传入HTTP代理。
我不想跑码头工人,撰写构建和我得到以下错误:
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 ("2.0", "2.1", "3.0", "3.1", "3.2") 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.
这里是我的搬运工,compose.yml:
version: ‘2’
services:
web:
build: .
context: .
args:
- http_proxy
- https_proxy
- no_proxy
command: bundle exec rails s -b 0.0.0.0
volumes:
- .:/app
ports:
- "3000:3000"
depends_on:
- db
environment:
- POSTGRESQL_PASSWORD=abcd12345
db:
image: postgres:9.6.2-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_DB: myappnameapp_development
我试图改变版本到3并完全删除它,但它总是错误。
我的第二个问题 - 当我尝试运行docker-compose来通过代理时,是否必须传入任何参数?
任何想法?
通过他们构建的论点你试过删除版本...我意思是删除版本层并运行docker-compose.yml –
如果我拿出版本,我得到这个:服务的不支持的配置选项:'web' – user3437721
如果我拿出我得到的版本和服务:错误:Compose文件'./docker-compose.yml'无效,因为: Web不支持的配置选项:'depends_on – user3437721