I have created Docker containers using Docker-compose and ran them using docker stack deploy commands
version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: client:latest
command: "/app/startserver.sh ${hostname}"
deploy:
replicas: 3
mode: replicated
ports:
- "8999:8999"
networks:
- webnet
service:
# replace username/repo:tag with your name and image details
image: service:latest
deploy:
replicas: 1
mode: replicated
ports:
- "38080:8080"
networks:
webnet:
Docker stack deploy -c docker-compose.yml sampleservice would start the services with expected replicas . Now Once the containers are up it shutsdown immediately and new containers are created and this continues throughout.
Even the startserver.sh file has sleep infinity placed at the end and still it goes down and new ones are created . I am unable to find the reason for the termination . I tried docker stack ps sampleservice and I dont see any details in the error column .
I just checked . If the replica service for web is 2 . Then it works fine . When I increase it it kills once the containers are up . Any idea folks about this behaviour.
I did . I dont see anything odd. . As soon as the container is up , new containers are spinned up and old ones are removed . happening when I increase the replica to 3 fow web
Damn , In the client I am downloading a file from artifact and then start the same . Seems all of 3 containers have stopped in the miidle of the download process .
i think it should be something related to timeout . As with 2 containers its able to process when I increase the timeout lapses … What you think !!
ok, i have never seen a problem with artifactory like this…
i might try this manually (a script to download the artifacts) and run it multiple times concurrently to see if you can replicate the problem without containers and find the cause.
I think I caught the issue . Its with the memory . My service container takes 38% and all the 3 web takes 44.8% . So this lead to crash . Increase in my memory or maintaing it to 2 should work Thanks a lot for your response .