Docker service with ulimit
ulimit
option is not available for docker services. You can instead create a configuration file (mylimits.conf) with the necessary configuration and add (or update) it to your service.
# docker config create mylimits.conf# docker service create \ --name nginx \ --config source=mylimits.conf,target=/etc/security/limits.d/mylimits.conf \ nginx:latest \ sh -c "exec nginx -g 'daemon off;'"