title: On stack deploy, unable to pin image to digest: unauthorized: the client does not have permission for manifest
body: <p>I'm running a Docker stack using a custom image which I have pushed to an Artifactory repository.</p>
  
  <p>docker-compose.yml:</p>
  
  <pre><code>version: "3"
  
  services:
    app:
      image: repo.example.com/my_image:latest
  </code></pre>
  
  <p>I can pull the image fine, and I can deploy the stack fine, but if I try to redeploy the stack, I get an error.</p>
  
  <pre><code>$ docker stack deploy --with-registry-auth -c docker-compose.yml my_stack
  Creating network my_stack_default
  Creating service my_stack_app
  
  $ docker stack deploy --with-registry-auth -c docker-compose.yml my_stack
  Updating service my_stack_app (id: 8po6oepjdgo8kwsb7n4ig64dt)
  unable to pin image repo.example.com/my_image:latest to digest: unauthorized: The client does not have permission for manifest
  </code></pre>
  
  <p>I expect Docker to update the image when I redeploy the stack, just like it would if I used an image from Docker Hub.</p>
  
  <p>I've seen Docker say <code>unable to pin image</code> before, but that was when I did not specify a repository (e.g. docker.io).  I know I have permission from <code>repo.example.com</code> because I pushed the image there, I can still pull from it, and I can start the stack.  I just can't update it.</p>
  
  <p>What does this <code>client does not have permission for manifest</code> error mean, and how do I fix this issue?</p>