I have a problem with my docker swarm. I created a new service with the following command:

docker-compose config | docker stack deploy -c - serviceNameX --with-registry-auth

The docker-compose file looks like that:

version: '3.1'
    image: ${DOCKER_REGISTRY}imageNameX:${VERSION}
          memory: 2gb
      - ../common.env
      - .env

      name: ${DOCKER_NETWORK}

fyi: docker-compose config is used because docker stack deploy can't expand environment variables. At least to my knowledge.

docker service ps serviceNameX

ID                  NAME                              IMAGE                                                         NODE                DESIRED STATE       CURRENT STATE       ERROR               PORTS
ify7vhl0l2m8        serviceNameX.1   nexus.local/imageNameX:1                                                                           Running             New 2 hours ago

docker service ls

afnjo97f6nuf        serviceNameX                      replicated          0/1                 nexus.local/imageNameX:1

All nodes are Ready and Active

There is no indication or information of an error. Usually docker service ps shows if an error occurs. Is there another useful log?

  • Other useful tools could be docker events, docker service inspect, and docker container inspect (on that ify7vhl0l2m8). I'd also do a watch docker service ps serviceNameX to see if tasks were re-spawing but indeed it's weird to see a single task "running" but a 0/1 in service ls. Mar 23, 2018 at 3:56
  • The output was a little bit displaced, but actually the desired state is RUNNING and the actual state is NEW
    – anstue
    Mar 23, 2018 at 14:55

1 Answer 1


Try do pull your image manually first.

docker pull ${DOCKER_REGISTRY}imageNameX:${VERSION}

And then re-run your compose-file

It may be a bug using a private registry, or something simple as you don't have enough disk space to pull the image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.