11

I am using docker-compose.yml to deploy services in a docker swarm which has cluster of raspberry pis. My services require access to the raspberry pi GPIO and needs privileged mode. I am using docker version 18.02 with docker-compose version 3.6. When I deploy the stack, I receive the following message and the services do not get deployed: "Ignoring unsupported options: privileged". Any tips? Below is my docker-compose.yml file

version: '3.6'     

networks:
    swarm_network:
        driver: overlay


services:
    service1:
        image: localrepo/img1:v0.1
        privileged: true
        deploy:
            mode: replicated
            replicas: 1
            placement:
                constraints:
                    - node.hostname == home-desktop

        ports:
            - published: 8000
              target: 8000
              mode: host

        networks:
            swarm_network:

    service2:
        image: localrepo/img1:v0.1 
        privileged: true
        deploy:
            mode: replicated
            replicas: 1

        ports:
            - published: 7000
              target: 7000
              mode: host

        networks:
            swarm_network:

    nodeViewer:
      image: alexellis2/visualizer-arm:latest
      ports:
        - "8080:8080"
      volumes:
        - "/var/run/docker.sock:/var/run/docker.sock"
      deploy:
        placement:
          constraints: [node.role == manager]
      networks:
        - swarm_network
eth crypt
  • 277
  • 2
  • 4
  • 10

2 Answers2

6

Thats because privileged is not supported in docker swarm. I had a similar docker compose running in privileged mode but while using it to docker swarm I removed them and was working well.

That not exactly an error .For example if you use something like links or depends_on . You get similar warning message. These are just the warnings not errors.

This is how you actually check the error logs if there is any

docker service ls (to check running service) 

docker service logs servicename
Tara Prasad Gurung
  • 3,422
  • 6
  • 38
  • 76
  • I know it is not an error message. It is just privileged mode isn't supported in docker swarm. But I want to deploy my services over a cluster of devices. Can I use docker compose to do that without the swarm mode?? Meaning that, is it possible to orchestrate services over cluster of nodes with just docker compose? – eth crypt Feb 19 '18 at 08:11
  • I don't think that is possible only with docker-compose – Tara Prasad Gurung Feb 19 '18 at 10:32
1

Whole feature is implemented and works as far I can see so who ever want to test it can do it by downloading latest nightly build of Docker engine (dockerd) from https://master.dockerproject.org and the custom build version of Docker CLI from https://github.com/olljanat/cli/releases/tag/beta1 You can also find usage examples for CLI from docker/cli#2199 and for Stack from docker/cli#1940 If you find bugs from those please leave comment to correct PR. Also notice that syntax might still change during review.

Source: https://github.com/moby/moby/issues/25885#issuecomment-557790402

I've personally tested it and it works like a charm. thanks to the author.

Farzan
  • 745
  • 10
  • 25