When I was building the environment with Docker, I encountered such a build error.
ERROR: In file './docker-compose.yml', service must be a mapping, not a NoneType.
Post a memorandum on how to deal with this error and why it occurred.
Because the indentation is inappropriate. Probably some half-width space is missing.
Suppose you get an error in docker-compose.yml like this. Example
version: "3"
services:
react-navigation:
build: ./
volumes:
- ./react-navigation/:/usr/src/app
env_file: .env
command: bash -c "cd example && yarn start"
ports:
- "19000:19000"
- "19001:19001"
- "19002:19002"
As a solution, add two half-width spaces under react-navigation and change it like this.
version: "3"
services:
react-navigation:
build: ./
volumes:
- ./react-navigation/:/usr/src/app
env_file: .env
command: bash -c "cd example && yarn start"
ports:
- "19000:19000"
- "19001:19001"
- "19002:19002"
Probably an error that people who have just learned Docker will encounter. I hope this article will be useful for those people and myself.
Recommended Posts