Skip to content

Use with docker stack #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
piotr-sikora-v opened this issue Sep 30, 2020 · 5 comments
Open

Use with docker stack #14

piotr-sikora-v opened this issue Sep 30, 2020 · 5 comments

Comments

@piotr-sikora-v
Copy link

There is any option to use it with docker stack ?
I try to deploy with

services:
  grafana:
    image: grafana/grafana:5.1.0
  user: '104'
    volumes:
     - docker/volumes/swarmpit-grafana:/var/lib/grafana
volumes:
  grafana-data:
    driver: zfs
    driver_opts:
      name: docker/volumes/grafana

but it don't work, container don't start
from command line docker volume create -d zfs --name=docker/volumes/grafana works

@mikroskeem
Copy link

Are you sure you wrote the yaml correctly?

volumes:
  data:
    name: "rpool/docker-volumes/monitoring/tsdb-data"
    driver: "zfs"
    driver_opts:
      atime: "off"

That's what I use, works perfectly.

@piotr-sikora-v
Copy link
Author

what version do you use ?
I have error:
Stack update failed. name Additional property name is not allowed

code:

version: '3.3'
services:
  redis:
    image: redis:alpine
    networks:
     - default
    logging:
      driver: json-file
  web:
    image: nginx:latest
    volumes:
     - data:/var/log/nginx
    networks:
     - default
    logging:
      driver: json-file
networks:
  default:
    driver: overlay
volumes:
  data:
    name: "docker/volumes/test1"
    driver: "zfs"
    driver_opts:
      atime: "off"

@mikroskeem
Copy link

Oh I misread partially, sorry - still morning for me. Managed to read Docker compose before. That being said, I'm using docker-compose.yml version 2.4 😄

@piotr-sikora-v
Copy link
Author

no-problem ;)
with docker-compose this works... for docker stack I have only workaround to create volme then:

...
    volumes:
      - data:/data
volumes:
  data:
    external:
      name: docker/volumes/data

@kerberizer
Copy link

kerberizer commented Sep 8, 2021

I have error:
Stack update failed. name Additional property name is not allowed

code:

version: '3.3'
(...)

@piotr-sikora-v The name property for the volumeskey was added in version 3.4 of the compose file. Unless you have something incompatible with this version in your compose file, changing the version of your compose file to 3.4 (or higher) should work.

P.S. Yes, I mean it should work also for docker stack deploy, not just for docker-compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants