Tag Archives: deploy

Failed to start docker.service: Unit not found(Docker service does not start)

Linux deployment docker appears: failed to start docker.service : unit not found
linux has deployed k8s and other projects before, Some of the remaining dockers are damaged
after re installation, the service always fails: failed to start docker.service : unit not found
warning: if applicable to my situation, it needs to be reinstalled

solution:
Direct Yum update
be sure to restart Linux
Yum install docker
systemctl start docker.service

【docker】 yaml.scanner.ScannerError: mapping values are not allowed here in “./docker-compo…

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!