<p>Try do pull your image manually first.</p>
<pre><code>docker pull ${DOCKER_REGISTRY}imageNameX:${VERSION}
</code></pre>
<p>And then re-run your compose-file</p>
<p>It may be a bug using a private registry, or something simple as you don't have enough disk space to pull the image.</p>

CC BY-SA 4.0
2018-03-22T13:50:24.680Z
2020-10-26T18:34:54.647Z
2020-10-26T18:34:54.647Z
Lucas Fantacucci
<p>I have a problem with my docker swarm. I created a new service with the following command:</p>

<pre><code>docker-compose config | docker stack deploy -c - serviceNameX --with-registry-auth
</code></pre>

<p>The docker-compose file looks like that:</p>

<pre><code>version: '3.1'
services:
  serviceNameX:
    image: ${DOCKER_REGISTRY}imageNameX:${VERSION}
    deploy:
      resources:
        limits:
          memory: 2gb
    env_file:
      - ../common.env
      - .env

networks:
  default:
    external:
      name: ${DOCKER_NETWORK}
</code></pre>

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

<p>docker service ps serviceNameX</p>

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

<p>docker service ls</p>

<pre><code>afnjo97f6nuf        serviceNameX                      replicated          0/1                 nexus.local/imageNameX:1
</code></pre>

<p>All nodes are Ready and Active</p>

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

CC BY-SA 3.0
2018-03-23T03:56:59.473Z
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.
Bret Fisher
CC BY-SA 3.0
2018-03-23T14:55:31.870Z
The output was a little bit displaced, but actually the desired state is RUNNING and the actual state is NEW
anstue
<docker><docker-compose><docker-swarm>
Docker swarm replica stays 0/1 and service stays in status new
anstue
# Docker swarm replica stays 0/1 and service stays in status new

(Asked by: username_0 on 2018-03-21)

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'
services:
  serviceNameX:
    image: ${DOCKER_REGISTRY}imageNameX:${VERSION}
    deploy:
      resources:
        limits:
          memory: 2gb
    env_file:
      - ../common.env
      - .env

networks:
  default:
    external:
      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?

**Tags:** docker, docker-compose, docker-swarm

> **Comments:**
> **username_1**: 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.  
> **username_0**: The output was a little bit displaced, but actually the desired state is RUNNING and the actual state is NEW  

---

## 1 answers

### Answer by username_2 on 2018-03-22. Score: 2

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.


---

