cpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit and mem_swappiness are deprecated in version3.x
when using 3 version of docker-compose, we can use deploy for non swarm mode or swarm mode, such as

version: "3.7"
services:
  redis:
    image: redis:alpine
    container_name: testredis
    deploy:
      resources:
        limits:
          cpus: '0.50'
docker-compose --compatibility up

–compatibility is required (taken from the documentation): If set, Compose will attempt to convert deploy keys in v3 files to their non-Swarm equivalent

(Author)
No description.Please update your profile.

View all post by admin

Leave Comments

我们立足于美利坚合众国,对全球华人服务,受北美法律保护