Lemuntu

[Play Docker]How to build up an DLNA server

3 1686
Edited by john.wen at Jul 14, 2016 19:48

How to build up an DLNA server



1. DLNA Introuction

DNLA, Digital Living Network Alliance, is a communication protocol between PC, mobie devices and consumer electronics. DLNA was formulated by Sony, Intel, Microsoft and so on. Its aim is to "enjoy music, photos and videos on the go."


2. Install Docker

Please refer 《How to install docker on the Lemuntu》 to learn how to install docker. In this article, we will teach you how to install docker on Lemuntu.


3. Build up a DLNA server

Step 1: Install debian image on docker

Type the bellow command to search debian image
  1. docker search debian
Copy the Code



Type the bellow command to install debian image
  1. docker pull armbuild/debian
Copy the Code



Step 2: Build up minidlna server

Run debian image in docker
  1. sudo docker run -t -i -p 8200:8200 armbuild/debian /bin/bash
Copy the Code
-p 8200:8200 represents that DLNA server's 8200 port is mapped to the host's 8200 port.

Install minidlna
  1. sudo apt-get upgrade
  2. sudo apt-get update
  3. sudo apt-get install minidlna
Copy the Code
Configure ninidlna,edit /etc/minilna.conf
  1. ……
  2. # If you want to restrict a media_dir to a specific content type, you can
  3. # prepend the directory name with a letter representing the type (A, P or V),
  4. # followed by a comma, as so:
  5. #   * "A" for audio    (eg. media_dir=A,/var/lib/minidlna/music)
  6. #   * "P" for pictures (eg. media_dir=P,/var/lib/minidlna/pictures)
  7. #   * "V" for video    (eg. media_dir=V,/var/lib/minidlna/videos)
  8. media_dir=A,/var/lib/minidlna/music
  9. media_dir=P,/var/lib/minidlna/pictures
  10. media_dir=V,/var/lib/minidlna/videos

  11. # Path to the directory that should hold the database and album art cache.
  12. db_dir=/var/cache/minidlna
  13. ……
  14. # IPv4 address to listen on (e.g. 192.0.2.1/24).
  15. # If omitted, the mask defaults to 24. The IPs are added to those determined
  16. # from the network_interface option above.
  17. # This option can be specified more than once.
  18. #listening_ip=192.168.0.254

  19. # Port number for HTTP traffic (descriptions, SOAP, media transfer).
  20. # This option is mandatory (or it must be specified on the command-line using
  21. # "-p").
  22. port=8200
  23. ……
  24. # Name that the DLNA server presents to clients.
  25. # Defaults to "hostname: username".
  26. friendly_name=LeMaker-DLNA
Copy the Code

Create meida files
  1. mkdir -p /var/lib/minidlna/music
  2. mkdir -p /var/lib/minidlna/pictures
  3. mkdir -p /var/lib/minidlna/videos
Copy the Code

Start minidlna,and set minidlna to start when start the OS
  1. sudo service minidlna force-reload
  2. sudo update-rc.d minidlna defaults
Copy the Code

Type the bellow command to list minidlna server
  1. sudo service --status-all | grep minidlna
Copy the Code

Step 3: Use DLNA server

After install minidlna server, we can use PC web browser to list multimedia resources. Assume that the host(LeMaker Guitar)'s IP is 192.168.0.45.



We also can play the video files on mobile phone.Open the web browser and input:  http://192.168.0.45:8200/MediaItems/21.mp4.





4. Save a docker image
When we successfully build up a DLNA server, If we want to migrate the DLNA server to other device and don't need to rebuild up again. We can use the bellow command to make docker image.
  1. sudo docker commit 614122c0aabb armbuild/debian-minidlna
Copy the Code
As to 614122c0aabb, we can use "docker ps -l" to get the container ID.


hnsncxy  
Good sharing

Thank you,
Just a quick note...
"Docker Images" command does not list the "container-id" which is needed to save the image.It give you the "Image ID" which does not help you to save the image. (image-1)

To grab the container-id we should use command " docker ps -a" (image-2)

Or, if you run the "docker run ..." command, you can see the container ID in prompt. (image-3)

image.png

Cheers,

sghazagh replied at Jun 19, 2016 16:43
Thank you,
Just a quick note...
"Docker Images" command does not list the "container-id" which is n ...

Yes, you are right, Thank you!

You have to log in before you can reply Login | Sign Up

Points Rules