简体   繁体   中英

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused \"exec

Failed to start a docker with docker compose on MAC (docker desktop)

Here is the output from docker inspect:

{
                        "Start": "2019-06-10T13:30:15.2105502Z",
                        "End": "2019-06-10T13:30:15.3055115Z",
                        "ExitCode": -1,
                        "Output": "OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused \"exec: \\\"curl\\\": executable file not found in $PATH\": unknown"
                   }

The section in docker compose is:

mydocker:
    image: mydocker
    container_name: mydockername
    hostname: mydockerhostname
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 1m30s
      timeout: 10s
      retries: 3
    networks:
      - confluent
    ports:
      - "8080-8090:8080"
    volumes:
      - myvolume:/pathname
    command:
      - start
      - --insecure

I used the docker stop/start, or docker kill/run, but no success.

I was able to use the same docker compose script to launch the container several weeks ago, and I don't remember I have done anything on Mac, such as OS upgrade, to cause the problem.

It appears that the Docker image you're using doesn't have curl installed.

Assuming that it's based on Debian or Ubuntu you need to add RUN apt-get update && apt-get install -y curl to your Dockerfile . If it's Alpine then RUN apk update && apk add curl should do the trick.

After you rebuild the mydocker image ( docker-compose build mydocker ), docker-compose up should work (assuming there are no other problems). You can also rebuild and start containers in one go: docker-compose up --build .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question OCI runtime exec failed: exec failed: container_linux.go:344: starting container process OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: <PATH>: Cannot restart container OCI runtime create failed: container_linux.go:367: starting container process caused: exec:: permission denied: unknown Docker: OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”java\“: executable file not found in $PATH” OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”xxxx\“: executable file not found in $PATH”: unknown OCI runtime create failed: container_linux.go:348: starting container process caused “exec: \”-it\“: executable file not found in $PATH”:unknown Docker on Windows: failed: container_linux.go:344: starting container process caused “exec: \”./gradlew\“: stat ./gradlew: no such file or directory” OCI runtime create failed: container_linux.go:349: starting container process caused “exec: \”r-base\“: executable file not found in $PATH”: unknown Cannot start service api: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "python manage.py runserver
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM