• 23 Posts
  • 47 Comments
Joined 3 years ago
cake
Cake day: June 9th, 2023

help-circle



























  • rglullis@communick.newstoDockerShared Volumes Question
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 years ago

    I don’t know if you had any issue with the formatting, but your first example is not going to work because you are putting the volumes mapping at the top-level. The correct would be:

    version: "3.8"
    
    services: 
      example1:
        image: example.com/example1:latest
        ports: "8000:80"
        volumes: 
          - shared_example:/data
    
      example2:
        image: example.com/example2:latest
        ports: "8080:80"
        volumes: 
          - shared_example:/data
    
    volumes:
      shared_example: 
        driver_opts: 
          type: nfs
          o: "192.100.1.100, nolock,soft,rw"
          device: ":/local/shared"