{"id":883,"date":"2019-01-16T15:52:28","date_gmt":"2019-01-16T14:52:28","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=883"},"modified":"2020-11-21T22:22:47","modified_gmt":"2020-11-21T21:22:47","slug":"nfs-in-docker-compose","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/","title":{"rendered":"NFS in Docker-Compose"},"content":{"rendered":"<p>My main Docker deployments are on a single linux server. I have a central &#8216;data&#8217; directory where I keep my common data. The application specific data or settings are stored in \/srv\/<application-name>.<\/p>\n<p>But for testing or demos I am usually using local Docker installations on my McBook or McBook Air under OS\/X. I am using NFS to access the shared central data.<\/p>\n<p>In this Blog I give a quick overview of the setup:<\/p>\n<ul>\n<li>Install the NFS Server. There are plenty of good tutorials on the Internet that describe how to do this. I was using <a href=\"https:\/\/help.ubuntu.com\/community\/SettingUpNFSHowTo\">this<\/a>. It would even be an option to run the NFS Server as Docker Container.<\/p>\n<\/li>\n<li>\n<p>Create Exports for the Directories on the Server. Fortunately I could use the NFS Exports screen from <a href=\"http:\/\/www.webmin.com\/\">Webmin<\/a>. Here is the definition for sharing the \/srv directory:<br \/>\n<img decoding=\"async\" src=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs-300x131.png\" alt=\"\" width=\"100%\"  class=\"alignnone size-medium wp-image-884\" srcset=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs-300x131.png 300w, https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs-768x334.png 768w, https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs.png 1156w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<\/li>\n<\/ul>\n<p>I am using a <a href=\"https:\/\/my.zerotier.com\/\">Zerotier<\/a> virtual Network so that I can access my local resources also from the public Internet. Therefore I was defining the corresponding IP network and netmask.<\/p>\n<ul>\n<li>Now we are ready to use the exported directories. Here is the <em>docker-compose.yml<\/em> file which is using NFS volumes:\n<pre><code>version: '3.2'\nservices:\n  beakerx:\n    image: pschatzmann\/data-science:1.2.0\n    container_name: beakerx\n    hostname: beakerx\n    restart: always\n    ports:\n      - 8007:8888\n      - 9000:9000\n    volumes:\n      - nfs-srv:\/home\/beakerx\n      - nfs-data:\/data\n    environment:\n      - TZ=Europe\/Zurich\n    dns:\n      - 8.8.8.8\n    extra_hosts:\n      - \"nuc.local:10.147.17.177\"\n\nvolumes:\n  nfs-srv:\n     driver: local\n     driver_opts:\n       type: nfs\n       device: \":\/srv\/data-science\"\n       o: \"addr=10.147.17.177,nolock,soft,rw\"\n\n  nfs-data:\n     driver: local\n     driver_opts:\n       type: nfs\n       device: \":\/data\"\n       o: \"addr=10.147.17.177,nolock,soft,rw\"\n<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>My main Docker deployments are on a single linux server. I have a central &#8216;data&#8217; directory where I keep my common data. The application specific data or settings are stored in \/srv\/. But for testing or demos I am usually using local Docker installations on my McBook or McBook Air [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":884,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-883","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-infrastructure"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>NFS in Docker-Compose - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"NFS in Docker-Compose - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"My main Docker deployments are on a single linux server. I have a central &#8216;data&#8217; directory where I keep my common data. The application specific data or settings are stored in \/srv\/. But for testing or demos I am usually using local Docker installations on my McBook or McBook Air [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-16T14:52:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-21T21:22:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1156\" \/>\n\t<meta property=\"og:image:height\" content=\"503\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"NFS in Docker-Compose\",\"datePublished\":\"2019-01-16T14:52:28+00:00\",\"dateModified\":\"2020-11-21T21:22:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/\"},\"wordCount\":191,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/nfs.png\",\"articleSection\":[\"Infrastructure\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/\",\"name\":\"NFS in Docker-Compose - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/nfs.png\",\"datePublished\":\"2019-01-16T14:52:28+00:00\",\"dateModified\":\"2020-11-21T21:22:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/nfs.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/nfs.png\",\"width\":1156,\"height\":503},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2019\\\/01\\\/16\\\/nfs-in-docker-compose\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"NFS in Docker-Compose\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"NFS in Docker-Compose - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/","og_locale":"en_US","og_type":"article","og_title":"NFS in Docker-Compose - Phil Schatzmann","og_description":"My main Docker deployments are on a single linux server. I have a central &#8216;data&#8217; directory where I keep my common data. The application specific data or settings are stored in \/srv\/. But for testing or demos I am usually using local Docker installations on my McBook or McBook Air [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/","og_site_name":"Phil Schatzmann","article_published_time":"2019-01-16T14:52:28+00:00","article_modified_time":"2020-11-21T21:22:47+00:00","og_image":[{"width":1156,"height":503,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"NFS in Docker-Compose","datePublished":"2019-01-16T14:52:28+00:00","dateModified":"2020-11-21T21:22:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/"},"wordCount":191,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs.png","articleSection":["Infrastructure"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/","url":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/","name":"NFS in Docker-Compose - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs.png","datePublished":"2019-01-16T14:52:28+00:00","dateModified":"2020-11-21T21:22:47+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2019\/01\/nfs.png","width":1156,"height":503},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2019\/01\/16\/nfs-in-docker-compose\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"NFS in Docker-Compose"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=883"}],"version-history":[{"count":1,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/883\/revisions"}],"predecessor-version":[{"id":2187,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/883\/revisions\/2187"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/884"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=883"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=883"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}