我正在尝试学习如何利用docker-compose,并按照说明进行操作,直到收到错误消息。这是我的docker-compose文件。
version: '3'
services:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
images: jupyter/scipy-notebook:17aba6048f44
volume:
- ./:/home/notebook
ports:
- "8888:8888"
当我返回并输入“ docker-compose up -d --build”时,我会收到一条错误消息
The Compose file './docker-compose.yml' is invalid because:
Unsupported config option for services.db: 'jupyter'
我的docker-compose版本是1.23.2,并试图在Mac上运行它。有任何想法吗?提前致谢。 抱歉,我的英语不好,所以我指的是this question.
答案 0 :(得分:0)
version: '3'
services:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
image: jupyter/scipy-notebook:65761486d5d3
volumes:
- ./:/home/notebook
ports:
- "8888:8888"
答案 1 :(得分:0)
按如下所示进行编辑
version: '3'
services:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
image: jupyter/scipy-notebook:17aba6048f44
volumes:
- ./:/home/notebook
ports:
- "8888:8888"
答案 2 :(得分:0)
版本:“ 3”
服务:
db:
image: postgres:11.2-alpine
volumes:
- ./pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRESS_PASSWORD=${POSTGRESS_PASSWORD}
jupyter:
image: jupyter/scipy-notebook:17aba6048f44 # you write "images" but actually it should be image
volume:
- ./:/home/notebook
ports:
- "8888:8888"