Resolve Docker Compose ERROR: Cannot start service app: OCI runtime create failed

Docker Deployment

This post presents a solution to an error I encountred with Docker when I upgraded my Docker version on MacOS.

The error was with “Docker Compose” which said “ERROR: Cannot start service app: OCI runtime create failed”.

I had been using a docker compose file for a project for a while, when all of a sudden it seemed to stop working. The only change I had made was to upgrade my docker desktop install on MacOS. After this upgrade, I received the following errors when trying to bring up my container:

ERROR: for app  Cannot start service app: OCI runtime create failed: 
container_linux.go:349: starting container process caused 
"process_linux.go:449: container init caused \"process_linux.go:415:
ERROR: for app  Cannot start service app: 
OCI runtime create failed: container_linux.go:349: 
starting container process caused 
"process_linux.go:449: container init caused 
\"process_linux.go:415: 
setting cgroup config for procHooks process caused 
\\\"failed to write \\\\\\\"100\\\\\\\" to \\\\\\\"
/sys/fs/cgroup/cpu/docker/
913ed88f1270ffff1b77be970a2de69f453bb06d6c539a2aa7494a1525f8ce6a
/cpu.cfs_quota_us\\\\\\\": 
write /sys/fs/cgroup/cpu/docker/
913ed88f1270ffff1b77be970a2de69f453bb06d6c539a2aa7494a1525f8ce6a
/cpu.cfs_quota_us: invalid argument\\\"\"": unknown
ERROR: for app  Cannot start service app: 
OCI runtime create failed: container_linux.go:349: 
starting container process caused "process_linux.go:449: con

After trying a few different solutions which included messing with volumes and mounted drives etc, I finally found the error to be with some resource options I had in the docker compose file.

Once I removed these few options, the errors stopped, and I was able to bring up my container and work as I had been before.

I found the error to be the following line in the docker-compose file.

    deploy:
      resources:
        limits:
          cpus: '0.001'
          memory: 2gb

Once I removed these lines from the docker-compose file, I found this to resolve the error.

This was happening with docker compose version “3.3”

You can read more about how I have used docker in my other projects.

If you would like to read more about the background to this work, it was conducted as part of system development of the Clinical Imaging Review System (CIRS).

What can you do to improve your life as a programmer?

my article provides some ideas!