docker-compose.yml无效的类型

时间:2017-11-15 23:46:31

标签: docker docker-compose

搬运工-compose.yml

D1, D2, D3 = zip(*document_matrix_projections)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.quiver(D1)
plt.show()

当我运行version: '2.0' services: asdf-db: container_name: asdf-db build: ./asdf/db ports: - 5435:5432 # expose ports - HOST:CONTAINER environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres healthcheck: test: exit 0 asdf-service: container_name: asdf-service build: ./ volumes: - '.:/usr/src/asdf' ports: - 5001:5000 # expose ports - HOST:CONTAINER environment: - APP_SETTINGS=asdf.config.DevelopmentConfig - DATABASE_URL=postgres://postgres:postgres@asdf-db:5432/asdf_dev - DATABASE_TEST_URL=postgres://postgres:postgres@asdf-db:5432/asdf_test depends_on: asdf-db: condition: service_healthy links: - asdf-db 时,我收到以下错误消息:

docker-compose up -d

我已尝试将版本切换为2.1,然后我收到以下错误消息:

ERROR: The Compose file '.\docker-compose.yml' is invalid because:
Unsupported config option for services.asdf-db: 'healthcheck'
services.asdf-service.depends_on contains an invalid type, it should be an array

如何将asdf-db更改为对象?

1 个答案:

答案 0 :(得分:2)

2.1中添加了健康检查,因此您至少需要该版本。

在2.1版本中,您在links内有depends_on,但它应该在同一级别。