willfarrell / docker-autoheal

Monitor and restart unhealthy docker containers.
MIT License
1.31k stars 225 forks source link

docker-compose throwing error "No command specified" #94

Closed princeje closed 1 year ago

princeje commented 1 year ago
version: '3'

services:
  myservice:
    privileged: true
    image: myimage:latest
    container_name: mysensor
    volumes:
      - "/dev/bus/usb:/dev/bus/usb"
      - "/home/pi/healthcheck:/root/healthcheck"
    networks:
      myvlan:
        ipv4_address: 2.0.0.16
    tty: true
    labels:
       - "autoheal=true"
    healthcheck:
       test: ["CMD-SHELL", "/root/healthcheck/check_ERROR.sh" ]
       interval: 5s
       retries: 1
       start_period: 5s
       timeout: 19s
  autoheal:
    image: autoheal:latest
    tty: true
    container_name: autoheal
    network_mode: none
    environment:
      - AUTOHEAL_CONTAINER_LABEL=all
      # check every 5 seconds
      - AUTOHEAL_INTERVAL=5
      # wait 0 seconds before first health check
      - AUTOHEAL_START_PERIOD=0
      # Docker waits max 10 seconds (the Docker default) for a container to stop before killing during restarts
      - AUTOHEAL_DEFAULT_STOP_TIMEOUT=10
      # Unix socket for curl requests to Docker API
      - DOCKER_SOCK=/var/run/docker.sock
      # --max-time seconds for curl requests to Docker API
      - CURL_TIMEOUT=30
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always

Gives me this error when i try to start the containers:


pi@raspberrypi:~$ docker-compose -f docker-compose-autoheal-test.yml up -d
myservice is up-to-date
Creating autoheal ... error

ERROR: for autoheal  Cannot create container for service autoheal: No command specified

ERROR: for autoheal  Cannot create container for service autoheal: No command specified
ERROR: Encountered errors while bringing up the project.

What command is it expecting autoheal service to start with?

princeje commented 1 year ago
docker run -d \
    --name autoheal \
    --restart=always \
    -e AUTOHEAL_CONTAINER_LABEL=all \
    -v /var/run/docker.sock:/var/run/docker.sock \
    autoheal:latest

Gives me this error too:

pi@raspberrypi:~$ docker run -d \
>     --name autoheal \
>     --restart=always \
>     -e AUTOHEAL_CONTAINER_LABEL=all \
>     -v /var/run/docker.sock:/var/run/docker.sock \
>     autoheal:latest
docker: Error response from daemon: No command specified.
See 'docker run --help'.
princeje commented 1 year ago

close issue, image was not loaded properly into registry on the pi