0

I have deployed a container using the docker stack deploy command.

The service gets deployed properly and also the contianer is running.

I have specified some resource reservation constaints as follows:

      deploy:
        mode: replicated
        replicas: 1
        resources:
          reservations:
            cpus: '0.25'
            memory: 512M
        restart_policy:
          condition: on-failure
          max_attempts: 3

But when I try to check the allocated memory and cpu resources, the docker inspect container_name command shows 0 as their values

"Memory": 0,
"NanoCpus": 0,
phileinSophos
  • 362
  • 4
  • 22

1 Answers1

-2

I had also same issue using docker-compose to make up images via yaml fie. Issue was due to the docker-compose version. It worked in docker-compose version 1.29.0.

root@xprdpgntrsap02 bin]# docker inspect container_test01 |grep -i cpu

        "CpuShares": 0,
        "NanoCpus": 500000000,
        "CpuPeriod": 0,
        "CpuQuota": 0,
        "CpuRealtimePeriod": 0,
        "CpuRealtimeRuntime": 0,
        "CpusetCpus": "",
        "CpusetMems": "",
        "CpuCount": 0,
        "CpuPercent": 0,

hope it will be useful for someone