NGINX service failure in Dockers on limiting memory and CPU usage

I have one Master and 5 worker nodes, I am using the following command while deploying the nginx service.

It fails-

  • Server and client network apps simulated in one machine
  • Use perf inside a docker container without --privileged
  • How to mount container-writable host directory?
  • How to setup docker to talk to non-dockerized service on same host
  • How critical is dumb-init for Docker?
  • Limit Network access but allow a specific IP for a Running Docker Container
  • docker service create --name foo -p 32799:80 -p 32800:443  nginx --limit-cpu 0.5 --limit-memory 512M
    

    On the other hand this works-

    docker service create --name foo -p 32799:80 -p 32800:443  nginx
    

    Please let me know how do I reduce my CPU to 1 core and limit memory to 512M

  • How can I run bash in a new container of a docker image?
  • certbot.main:Exiting abnormally
  • Using variable interpolation in string in Docker
  • How do I expose a UDP Port on Docker?
  • Can’t link to MS Azure account
  • Can't get Docker image after windows installation
  • One Solution collect form web for “NGINX service failure in Dockers on limiting memory and CPU usage”

    Change your command to the following and try again:

    docker service create --limit-cpu 0.5 --limit-memory 512M --name foo -p 32799:80 -p 32800:443  nginx 
    

    Anything following the image name is treated as COMMAND and parameters.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.