An error was reported when starting docker compose
Command:
docker-compose up -d && docker-compose logs -f
Error code:
Solution
The reason for this error is that the YML format is incorrect. The YML format defined by Google is too strict. Every colon must be followed by a space
Original format:
version:"3"
services:
web:
image: licerlee/friendlyhello:v1
deploy:
replicas:5
resources:
limits:
cpus:"0.1"
memory:50M
restart_policy:
condition: on-failure
ports:
- "80:80"
networks:
- webnet
networks:
webnet:
Change to:
version: "3"
services:
web:
image: licerlee/friendlyhello:v1
deploy:
replicas: 5
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
ports:
- "80:80"
networks:
- webnet
networks:
webnet:
Note: the above example is for illustration only, not the configuration file of my project
When executing the command:
It’s over!
Similar Posts:
- [Solved] rocky-linux8.5 Install gitea Error: services.server Additional property db is not allowed
- [Solved] k8s Deploy postgresql Error: initdb: error: directory “/var/lib/postgresql/data” exists but is not empty
- [Solved] Mac docker Build Image apt-get update Error: GPG Signature Error
- Solution to pod error “back off restarting failed container”
- [Solved] MYSQL Error: [Warning] Changed limits: max_open_files: 1024
- [How to Solve] k8s pod erro exit code 137
- How to Solve C# upload Large File Error
- R6010 -abort() has been called error analysis and solutions
- Tuning and setting of memory and CPU on yarn cluster