Reputation: 2199
I've got a container running on one of my systems (outside of my Docker swarm) that links host directories as volumes:
docker run -d --name=plex --restart=always -v /plex/config:/config -v /movies:/movies --net=host -p 32400:32400 -e X_PLEX_TOKEN=$PLEXTOKEN wernight/plex-media-server:autoupdate
I'd like to get some high availability with my swarm so in case my Plex container goes down on one host it come up on another host. I'm using NFS for my mounts (movies and plex) and I've got them mounted on each host.
I've started with this:
docker service create --name plex --restart=any --mount /plex/config:/config --mount /movies:/movies -p 32400:32400 -e X_PLEX_TOKEN=$PLEXTOKEN wernight/plex-media-server:autoupdate
But this fails because mount is expecting a key=value pair. The documentation is sparse for not sure where to go from here. Without the mounts the service starts up fine.
What is the associated command to create a service that will bring up my "Plex" instance on other nodes in my swarm in case of a failure?
Upvotes: 1
Views: 1584
Reputation: 263597
I tend to agree that the docs here are pretty thin. Here's the syntax I've seen so far:
docker service create --name plex --restart=any \
--mount type=bind,source=/plex/config,target=/config \
--mount type=bind,source=/movies,target=/movies \
-p 32400:32400 -e X_PLEX_TOKEN=$PLEXTOKEN \
wernight/plex-media-server:autoupdate
There's also some discussion on changing this format over on github.
Upvotes: 3