Access private DockerHub repo in Docker Swarm
You need the --with-registry-auth flag, e.g.:

docker stack deploy -c myapp.yml --with-registry-auth myapp


From the docker stack deploy --help output:

--with-registry-auth     Send registry authentication details to Swarm agents