简体   繁体   中英

docker compose with swarm - is it obsolete?

I am using docker compose to load up services on the swarm currently. Is this now obsolete? I am curious whether the approach is right going forward. compose gives me a great deal of configurability in deploying to a stack and it is in one place for anybody to maintain. There are great advantages. However, I wonder if this is the approach adopted by the community. Insight would be great.

The docker-compose approach is the standard way to use docker with swarm. It is by no means obsolete.

The simplified version of Docker swarm was introduce in 1.12 and the docker deploy with compose file command was introduced in 1.13. If you see the official documentation on https://docs.docker.com/engine/swarm/stack-deploy/#create-the-example-application

The sample compose file that they use is

version: '3'

services:
  web:
    image: 127.0.0.1:5000/stackdemo
    build: .
    ports:
      - "8000:8000"
  redis:
    image: redis:alpine

So this definitely what the docker team wants us to use. And you are in the right direction.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM