Hello,
I have run into an issue with spinning up containers for certain images within the context of a swarm. Specifically, bare OS containers alternate between running and shutdown states when I use them in a stack. I have no issues running the same images as stand alone containers either in interactive or detached mode. I don’t have this issue with database images like redis, mongo, or other services like nats-streaming.
For instance the following .yml script is able to spin up a swarm without issue:
version: '3.7'
services:
nats:
networks:
- net
image: nats-streaming
configs:
- nats_config
mongo:
networks:
- net
image: mongo
configs:
- mongo_config
networks:
net:
configs:
nats_config:
file: ../nats.conf
mongo_config:
file: ../mongod.conf
However, the script below results in the ubuntu container starting up and shutting down repeatedly.
version: '3.7'
services:
master:
networks:
- net
image: ubuntu
ports:
- 9000:9000
nats:
networks:
- net
image: nats-streaming
configs:
- nats_config
mongo:
networks:
- net
image: mongo
configs:
- mongo_config
networks:
net:
configs:
nats_config:
file: ../nats.conf
mongo_config:
file: ../mongod.conf
The only difference is I have added another container in the stack. If I were to replace the ubuntu image with redis or postgres I would not have an issue.
Thanks!