-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
152 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
# logitechmediaserver-docker | ||
Logitechmediaserver in a container | ||
|
||
Logitechmediaserver in a container. | ||
|
||
## Configuration | ||
|
||
Variables at the start of the `logitechmediaserver-docker` script allow these settings to be customised: | ||
|
||
1. logitechmediaserver version | ||
2. directories to mount from the host | ||
3. ports | ||
|
||
## Quickstart | ||
|
||
``` | ||
$ logitechmediaserver-docker settings | ||
... | ||
$ logitechmediaserver-docker pull | ||
$ logitechmediaserver-docker create | ||
$ logitechmediaserver-docker start | ||
$ logitechmediaserver-docker logs | ||
... | ||
$ logitechmediaserver-docker stop | ||
... | ||
$ logitechmediaserver-docker delete | ||
``` | ||
|
||
## References | ||
|
||
1. https://hub.docker.com/r/lmscommunity/logitechmediaserver | ||
2. https://forums.slimdevices.com/showthread.php?111828-Official-docker-container-for-LMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/sh | ||
|
||
# see: https://hub.docker.com/r/lmscommunity/logitechmediaserver | ||
|
||
apt-get update -qq | ||
apt-get install --no-install-recommends -qy ffmpeg | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
|
||
lms_version=${lms_version:-8.2.0} | ||
|
||
lms_config=${lms_config:-/music/config} | ||
lms_music=${lms_music:-/music/music} | ||
lms_playlist=${lms_playlist:-/music/playlist} | ||
|
||
# mappings for specific ports; other option is --net=host | ||
# spotify 4070 | ||
lms_host_web_port=${lms_host_web_port:-9000} # TCP web UI | ||
lms_host_cli_port=${lms_host_cli_port:-9090} # TCP server CLI | ||
lms_host_players_port=${lms_host_players_port:-3483} # TCP/UDP control channel for client players (UDP is for discovery) | ||
lms_host_firmware_port=${lms_host_firmware_port:-31337} # firmware updates | ||
|
||
LMS_DOCKER_CONFIG=${LMS_DOCKER_CONFIG:-/etc/logitechmediaserver.conf} | ||
|
||
if [ -n "${LMS_DOCKER_CONFIG}" -a -f "${LMS_DOCKER_CONFIG}" ] ; then source "${LMS_DOCKER_CONFIG}" ; fi | ||
|
||
case "$1" in | ||
pull) | ||
docker pull "lmscommunity/logitechmediaserver:${lms_version}" | ||
;; | ||
create) | ||
docker create \ | ||
--name logitechmediaserver \ | ||
-v "${lms_config}":"/config":rw \ | ||
-v "${lms_music}":"/music":ro \ | ||
-v "${lms_playlist}":"/playlist":rw \ | ||
-v "/etc/localtime":"/etc/localtime":ro \ | ||
-v "/etc/timezone":"/etc/timezone":ro \ | ||
-p "${lms_host_web_port}:9000/tcp" \ | ||
-p "${lms_host_cli_port}:9090/tcp" \ | ||
-p "${lms_host_players_port}:3483/tcp" \ | ||
-p "${lms_host_players_port}:3483/udp" \ | ||
-p "${lms_host_firmware_port}:31337/tcp" \ | ||
"lmscommunity/logitechmediaserver:${lms_version}" | ||
;; | ||
start|run) | ||
[ ! -d "${lms_config}" ] && mkdir -p "${lms_config}" | ||
[ ! -d "${lms_music}" ] && mkdir -p "${lms_music}" | ||
[ ! -d "${lms_playlist}" ] && mkdir -p "${lms_playlist}" | ||
docker start logitechmediaserver | ||
;; | ||
stop) | ||
docker stop logitechmediaserver | ||
;; | ||
delete|rm) | ||
docker rm logitechmediaserver | ||
;; | ||
logs) | ||
docker logs -f logitechmediaserver | ||
;; | ||
settings) | ||
set | egrep '^lms_' | sort | ||
;; | ||
*) | ||
echo "Usage: $(basename $0) {pull|create|start|stop|delete|logs|settings}" | ||
;; | ||
esac | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# /etc/logitechmediaserver.conf: configuration for logitechmediaserver-docker | ||
|
||
#logitechmediaserver_version=8.2.0 | ||
|
||
#lms_config=/music/config | ||
#lms_music=/music/music | ||
#lms_playlist=/music/playlist | ||
|
||
#lms_host_web_port=9000 # TCP web UI | ||
#lms_host_cli_port=9090 # TCP server CLI | ||
#lms_host_players_port=3483 # TCP/UDP control channel for client players (UDP is for discovery) | ||
#lms_host_firmware_port=31337 # firmware updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=Logitechmediaserver Service | ||
After=network-online.target | ||
Description=Logitechmediaserver Docker Appliance Service | ||
Documentation=man:logitechmediaserver-docker(8) | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
Environment=LOGITECHMEDIASERVER_DOCKER_CONFIG=/etc/logitechmediaserver.conf | ||
WorkingDirectory=/var/tmp | ||
ExecStart=/usr/bin/logitechmediaserver-docker start | ||
ExecStop=/usr/bin/logitechmediaserver-docker stop | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# /etc/conf.d/logitechmediaserver: configuration for /etc/init.d/logitechmediaserver | ||
|
||
#LOGITECHMEDIASERVER_DOCKER_CONFIG=/etc/logitechmediaserver.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/sbin/openrc-run | ||
# Copyright 1999-2021 Gentoo Foundation | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
description="Logitechmediaserver in a container" | ||
|
||
depend() { | ||
need net docker | ||
} | ||
|
||
start() { | ||
ebegin "Starting Logitechmediaserver container" | ||
/usr/bin/logitechmediaserver-docker start | ||
eend $? | ||
} | ||
|
||
stop() { | ||
ebegin "Stopping Logitechmediaserver container" | ||
/usr/bin/logitechmediaserver-docker stop | ||
eend $? | ||
} |