First of all, to mention I checked multiple questions in Stackoverflow but the requirement was somewhat different or the solution offered was not working in my case, so thought of creating a new question.
overall progress: 0 out of 1 tasks 1/1: ready [======================================> ] verify: Detected task failure
Steps I have done:
docker service create --name registry --publish 5000:5000 armbuild/registry
(mine is raspi so used armbuild)
docker tag XYZImage localhost:5000/XYZImage
-> Working Fine
docker push localhost:5000/XYZImage
-> Working Fine
docker service create --name XYZService --replicas 2 localhost:5000/XYZImage
--> Issue Note: Even I tried using IP address and adding that address to insecure registries in daemon.json file.
Any leads? or if I am missing something?
Each container or node is writing to its own volume (/var/lib/registry). You must use a distributed storage driver if you want to use replicas.
From the documentation :
The storage back-end you use determines whether you use a fully scaled service or a service with either only a single node or a node constraint.
If you use a distributed storage driver, such as Amazon S3, you can use a fully replicated service. Each worker can write to the storage back-end without causing write conflicts.
If you use a local bind mount or volume, each worker node writes to its own storage location, which means that each registry contains a different data set. You can solve this problem by using a single-replica service and a node constraint to ensure that only a single worker is writing to the bind mount.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.