{"id":1011,"date":"2016-02-21T03:43:12","date_gmt":"2016-02-20T18:43:12","guid":{"rendered":"http:\/\/www.beeete2.com\/blog\/?p=1011"},"modified":"2018-02-21T22:40:07","modified_gmt":"2018-02-21T13:40:07","slug":"post-1011","status":"publish","type":"post","link":"https:\/\/www.beeete2.com\/blog\/?p=1011","title":{"rendered":"Docker\u3067ReadyMedia\uff08MiniDLNA\uff09\u3092\u8d77\u52d5\u3059\u308b"},"content":{"rendered":"<p>\u5bb6\u306bCentOS\u3067NAS\u3068\u3044\u3063\u3066\u3082RAID\u69cb\u6210\u306f\u3057\u3066\u3044\u306a\u3044\u7c21\u6613\u7684\u306a\u3082\u306e\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001Docker\u3067ReadyMedia\u3092\u8d77\u52d5\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u30db\u30b9\u30c8\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3082\u3088\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001FFmpeg\u3063\u3066\u5916\u90e8\u30ec\u30dd\u30b8\u30c8\u30ea\u53c2\u7167\u3057\u305f\u308a\u4f9d\u5b58\u7269\u3082\u591a\u304f\u3066\u3067\u304d\u308c\u3070\u30b2\u30b9\u30c8\u3068\u3057\u3066\u52d5\u304b\u3057\u305f\u3044\u3068\u3044\u3046\u306e\u304c\u52d5\u6a5f\u3067\u3059\u3002<\/p>\n<p>\u3064\u3044\u5148\u65e5\u307e\u3067CentOS6.6\u3067\u52d5\u304b\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001Docker\u3092\u3088\u304f\u4f7f\u3046\u306e\u3067CentOS7.1\u3078\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\nDLNA\u3068\u3044\u3048\u3070MediaTomb\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u6700\u8fd1\u66f4\u65b0\u304c\u6b62\u307e\u3063\u3066\u3044\u308b\u306e\u304bCentOS7.1\u3067\u306f\u3046\u307e\u304f\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u306a\u304b\u3063\u305f\u306e\u3067\u3001ReadyMedia\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<br \/>\nFFmpeg\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u304d\u3001\u81ea\u5206\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3059\u308b\u304b\u5916\u90e8\u30ec\u30dd\u30b8\u30c8\u30ea\u3092\u4f7f\u3046\u304b\u3067\u3044\u308d\u3044\u308d\u3084\u308a\u65b9\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001nux-dextop\u306e\u30ec\u30dd\u30b8\u30c8\u30ea\u304b\u3089\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u306b\u3057\u307e\u3057\u305f\u3002<br \/>\n\u81ea\u5206\u3067\u3001FFmpeg\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30aa\u30d7\u30b7\u30e7\u30f3\u7b49\u3092\u8abf\u6574\u3057\u305f\u3044\u3068\u3044\u3046\u65b9\u306f\u30bd\u30fc\u30b9\u304b\u3089\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u307b\u3046\u304c\u3088\u308a\u7d30\u304b\u304f\u8abf\u6574\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u3001Docker\u306e\u30b2\u30b9\u30c8OS\u3068\u3057\u3066\u8d77\u52d5\u3059\u308b\u306e\u3067yum\u3067\u304a\u624b\u8efd\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<h4>Docker\u30b3\u30f3\u30c6\u30ca\u306b\u542b\u3081\u308b\u30d5\u30a1\u30a4\u30eb<\/h4>\n<p><strong>start.sh<\/strong><br \/>\n[bash]<br \/>\n#!\/bin\/bash<\/p>\n<p>if [ ! -e \/etc\/sysctl.d\/readymedia.conf ]; then<br \/>\n  echo &quot;fs.inotify.max_user_watches = 100000&quot; &gt;&gt; \/etc\/sysctl.d\/readymedia.conf<br \/>\n  sysctl -p<br \/>\nfi<\/p>\n<p>\/usr\/local\/sbin\/minidlnad -d<br \/>\n[\/bash]<br \/>\nReadyMedia\u306e\u30ea\u30b9\u30c8\u306b\u8868\u793a\u3055\u305b\u308b\u30e1\u30c7\u30a3\u30a2\u306e\u6570\u304c8192\u3088\u308a\u591a\u3044\u3068\u3001\u305d\u308c\u4ee5\u4e0a\u30d5\u30a1\u30a4\u30eb\u3092\u8ffd\u52a0\u3067\u304d\u306a\u3044\u306e\u3067\u3001fs.inotify.max_user_watches\u306e\u6570\u3092100000\u306b\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n8192\u3088\u308a\u5c11\u306a\u3044\u5834\u5408\u306f\u6307\u5b9a\u3057\u306a\u304f\u3066\u3082\u3088\u3044\u3068\u601d\u3044\u307e\u3059\u3002sysctl\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u306fDocker\u306erun\u6642\u306b&#8211;privileged\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001Docker\u306b\u3088\u308a\u6a29\u9650\u3092\u4e0e\u3048\u308b\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3002<\/p>\n<h4>minidlna.conf<\/h4>\n<p>[bash]<br \/>\n# port for HTTP (descriptions, SOAP, media transfer) traffic<br \/>\nport=8200<\/p>\n<p># network interfaces to serve, comma delimited<br \/>\n#network_interface=eth0<\/p>\n<p># specify the user account name or uid to run as<br \/>\n#user=jmaggard<\/p>\n<p># set this to the directory you want scanned.<br \/>\n# * if you want multiple directories, you can have multiple media_dir= lines<br \/>\n# * if you want to restrict a media_dir to specific content types, you<br \/>\n#   can prepend the types, followed by a comma, to the directory:<br \/>\n#   + &quot;A&quot; for audio  (eg. media_dir=A,\/home\/jmaggard\/Music)<br \/>\n#   + &quot;V&quot; for video  (eg. media_dir=V,\/home\/jmaggard\/Videos)<br \/>\n#   + &quot;P&quot; for images (eg. media_dir=P,\/home\/jmaggard\/Pictures)<br \/>\n#   + &quot;PV&quot; for pictures and video (eg. media_dir=PV,\/home\/jmaggard\/digital_camera)<br \/>\nmedia_dir=A,\/media\/audio<br \/>\nmedia_dir=V,\/media\/video<br \/>\nmedia_dir=P,\/media\/picture<\/p>\n<p># set this to merge all media_dir base contents into the root container<br \/>\n# note: the default is no<br \/>\n#merge_media_dirs=no<\/p>\n<p># set this if you want to customize the name that shows up on your clients<br \/>\nfriendly_name=DLNA Server<\/p>\n<p># set this if you would like to specify the directory where you want MiniDLNA to store its database and album art cache<br \/>\n#db_dir=\/var\/cache\/minidlna<\/p>\n<p># set this if you would like to specify the directory where you want MiniDLNA to store its log file<br \/>\n#log_dir=\/var\/log<\/p>\n<p># set this to change the verbosity of the information that is logged<br \/>\n# each section can use a different level: off, fatal, error, warn, info, or debug<br \/>\n#log_level=general,artwork,database,inotify,scanner,metadata,http,ssdp,tivo=warn<\/p>\n<p># this should be a list of file names to check for when searching for album art<br \/>\n# note: names should be delimited with a forward slash (&quot;\/&quot;)<br \/>\nalbum_art_names=Cover.jpg\/cover.jpg\/AlbumArtSmall.jpg\/albumartsmall.jpg\/AlbumArt.jpg\/albumart.jpg\/Album.jpg\/album.jpg\/Folder.jpg\/folder.jpg\/Thumb.jpg\/thumb.jpg<\/p>\n<p># set this to no to disable inotify monitoring to automatically discover new files<br \/>\n# note: the default is yes<br \/>\ninotify=yes<\/p>\n<p># set this to yes to enable support for streaming .jpg and .mp3 files to a TiVo supporting HMO<br \/>\nenable_tivo=no<\/p>\n<p># set this to strictly adhere to DLNA standards.<br \/>\n# * This will allow server-side downscaling of very large JPEG images,<br \/>\n#   which may hurt JPEG serving performance on (at least) Sony DLNA products.<br \/>\nstrict_dlna=no<\/p>\n<p># default presentation url is http address on port 80<br \/>\n#presentation_url=http:\/\/www.mylan\/index.php<\/p>\n<p># notify interval in seconds. default is 895 seconds.<br \/>\nnotify_interval=900<\/p>\n<p># serial and model number the daemon will report to clients<br \/>\n# in its XML description<br \/>\nserial=12345678<br \/>\nmodel_number=1<\/p>\n<p># specify the path to the MiniSSDPd socket<br \/>\n#minissdpdsocket=\/var\/run\/minissdpd.sock<\/p>\n<p># use different container as root of the tree<br \/>\n# possible values:<br \/>\n#   + &quot;.&quot; &#8211; use standard container (this is the default)<br \/>\n#   + &quot;B&quot; &#8211; &quot;Browse Directory&quot;<br \/>\n#   + &quot;M&quot; &#8211; &quot;Music&quot;<br \/>\n#   + &quot;V&quot; &#8211; &quot;Video&quot;<br \/>\n#   + &quot;P&quot; &#8211; &quot;Pictures&quot;<br \/>\n#   + Or, you can specify the ObjectID of your desired root container (eg. 1$F for Music\/Playlists)<br \/>\n# if you specify &quot;B&quot; and client device is audio-only then &quot;Music\/Folders&quot; will be used as root<br \/>\n#root_container=.<\/p>\n<p># always force SortCriteria to this value, regardless of the SortCriteria passed by the client<br \/>\n#force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title<\/p>\n<p># maximum number of simultaneous connections<br \/>\n# note: many clients open several simultaneous connections while streaming<br \/>\n#max_connections=50<br \/>\n[\/bash]<br \/>\n\u4eca\u56de\u306e\u8a2d\u5b9a\u3067\u306f\u3001cache\u30d5\u30a1\u30a4\u30eb\u3092\u30db\u30b9\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u914d\u7f6e\u3057\u3066docker run\u6642\u306b\u30db\u30b9\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30de\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u30e1\u30c7\u30a3\u30a2\u30d5\u30a1\u30a4\u30eb\u306f\u30b3\u30f3\u30c6\u30ca\u4e0a\u304b\u3089\u306f\/media\/{audio,video,picture}\u3068\u3057\u3066\u3001docker run\u6642\u306b\u30db\u30b9\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30de\u30a6\u30f3\u30c8\u3057\u307e\u3059\u3002<br \/>\n\u305d\u306e\u4ed6\u306e\u8a2d\u5b9a\u306f\u57fa\u672c\u30c7\u30d5\u30a9\u30eb\u30c8\u3060\u3068\u601d\u3044\u307e\u3059\u30fb\u30fb\u30fb\u3002<\/p>\n<h4>Dockerfile\u306e\u5185\u5bb9<\/h4>\n<p>[bash]<br \/>\nFROM centos:centos7<\/p>\n<p>RUN yum -y update \\<br \/>\n    &amp;&amp; ln -fs \/usr\/share\/zoneinfo\/Asia\/Tokyo \/etc\/localtime<\/p>\n<p>RUN yum -y groupinstall &quot;Development Tools&quot; \\<br \/>\n    &amp;&amp; yum -y install git \\<br \/>\n    &amp;&amp; yum -y install libjpeg-turbo-devel libid3tag-devel libogg-devel libvorbis-devel flac-libs flac-devel wget sqlite-devel libexif-devel<\/p>\n<p>RUN yum -y install git vim \\<br \/>\n    &amp;&amp; yum -y install epel-release \\<br \/>\n    &amp;&amp; yum -y localinstall http:\/\/li.nux.ro\/download\/nux\/dextop\/el7\/x86_64\/nux-dextop-release-0-5.el7.nux.noarch.rpm \\<br \/>\n    &amp;&amp; yum -y install ffmpeg ffmpeg-devel<\/p>\n<p>RUN cd \/usr\/local\/src \\<br \/>\n    &amp;&amp; wget -O  minidlna-1.1.5.tar.gz &quot;http:\/\/downloads.sourceforge.net\/project\/minidlna\/minidlna\/1.1.5\/minidlna-1.1.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fminidlna%2F&amp;ts=1449585164&amp;use_mirror=jaist&quot; \\<br \/>\n    &amp;&amp; tar zxf minidlna-1.1.5.tar.gz \\<br \/>\n    &amp;&amp; cd minidlna-1.1.5 \\<br \/>\n    &amp;&amp; .\/configure &amp;&amp; make &amp;&amp; make install<\/p>\n<p>ADD minidlna.conf \/etc\/<\/p>\n<p>RUN echo &#8216;\/usr\/local\/lib&#8217; &gt; \/etc\/ld.so.conf.d\/minidlna.conf \\<br \/>\n    &amp;&amp; ldconfig<\/p>\n<p>ADD start.sh \/<br \/>\nRUN chmod +x \/start.sh<\/p>\n<p>CMD \/start.sh<br \/>\n[\/bash]<\/p>\n<h4>ReadyMedia\u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5<\/h4>\n<p>[bash]<br \/>\n# build<br \/>\ndocker build -t readymedia .<\/p>\n<p># run<br \/>\ndocker run -d -it \\<br \/>\n  &#8211;net=host \\<br \/>\n  &#8211;privileged \\<br \/>\n  -v \/datafs\/docker\/readymedia\/cache:\/var\/cache\/minidlna \\<br \/>\n  -v \/datafs\/dlna:\/media \\<br \/>\n  &#8211;name readymedia \\<br \/>\n  readymedia<br \/>\n[\/bash]<br \/>\n\u30d3\u30eb\u30c9\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002docker ps\u7b49\u3067readymedia\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308c\u3070\u8d77\u52d5\u306f\u3057\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u3042\u3068\u306fDLNA\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067\u8868\u793a\u3067\u304d\u308c\u3070\u554f\u984c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u5bb6\u306e\u74b0\u5883\u3067\u306fPS3\u3068Mac\u306eVLC\u3067\u518d\u751f\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb6\u306bCentOS\u3067NAS\u3068\u3044\u3063\u3066\u3082RAID\u69cb\u6210\u306f\u3057\u3066\u3044\u306a\u3044\u7c21\u6613\u7684\u306a\u3082\u306e\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001Docker\u3067ReadyMedia\u3092\u8d77\u52d5\u3057\u3066\u307f\u307e\u3057\u305f\u3002 \u30db\u30b9\u30c8\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3082\u3088\u304b\u3063\u305f\u306e\u3067\u3059\u304c\u3001FFmpeg\u3063 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":983,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[71],"views":8968,"_links":{"self":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1011"}],"collection":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1011"}],"version-history":[{"count":5,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions"}],"predecessor-version":[{"id":1029,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions\/1029"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/983"}],"wp:attachment":[{"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beeete2.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}