云原生之使用docker部署Subsonic音乐流媒体服务

简介: 云原生之使用docker部署Subsonic音乐流媒体服务

一、Subsonic介绍

Subsonic由挪威人Sindre Mehus采用Java语言编写而成。它具有一个强大的自动转换格式引擎,可通过将其即时转换为MP3来流式传输各种有损和无损格式。

二、检查本地环境

1.检查docker版本


[root@jeven ~]# docker version
Client: Docker Engine - Community
 Version:           20.10.21
 API version:       1.41
 Go version:        go1.18.7
 Git commit:        baeda1f
 Built:             Tue Oct 25 18:04:24 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.21
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.18.7
  Git commit:       3056208
  Built:            Tue Oct 25 18:02:38 2022
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.12
  GitCommit:        a05d175400b1145e5e6a735a6710579d181e7fb0
 runc:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
[root@jeven ~]#

2.检查docker状态

[root@jeven ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2022-12-13 23:18:38 CST; 1 weeks 3 days ago
     Docs: https://docs.docker.com
 Main PID: 123665 (dockerd)
    Tasks: 60
   Memory: 2.3G
   CGroup: /system.slice/docker.service
           ├─  1023 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 4567 -container-ip 172.31.0.3 -container-port 4...
           ├─  1028 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 4567 -container-ip 172.31.0.3 -container-port 4567
           ├─ 53581 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8080 -container-ip 172.17.0.2 -container-port 8...
           ├─ 53587 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.17.0.2 -container-port 8080
           ├─123665 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
           ├─130971 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 27117 -container-ip 172.31.0.2 -container-port ...
           └─130977 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 27117 -container-ip 172.31.0.2 -container-port 27017...

Dec 21 20:39:47 jeven dockerd[123665]: time="2022-12-21T20:39:47.594384282+08:00" level=warning msg="Failed to allocate a...in use"
Dec 21 20:39:47 jeven dockerd[123665]: time="2022-12-21T20:39:47.615584401+08:00" level=error msg="dbd5f6fc57c7375eac0a3b...tainer"
Dec 21 20:39:47 jeven dockerd[123665]: time="2022-12-21T20:39:47.615657859+08:00" level=error msg="Handler for POST /v1.41/conta...
Dec 21 21:07:33 jeven dockerd[123665]: time="2022-12-21T21:07:33.613099698+08:00" level=info msg="Container failed to exi...58d0d33
Dec 21 21:07:33 jeven dockerd[123665]: time="2022-12-21T21:07:33.672082582+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:07:33 jeven dockerd[123665]: time="2022-12-21T21:07:33.846567176+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:10:10 jeven dockerd[123665]: time="2022-12-21T21:10:10.815865446+08:00" level=info msg="Container failed to exi...175193d
Dec 21 21:10:10 jeven dockerd[123665]: time="2022-12-21T21:10:10.869591511+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:10:11 jeven dockerd[123665]: time="2022-12-21T21:10:11.021561879+08:00" level=info msg="ignoring event" contain...Delete"
Dec 21 21:15:51 jeven dockerd[123665]: time="2022-12-21T21:15:51.852283668+08:00" level=info msg="ignoring event" contain...Delete"
Hint: Some lines were ellipsized, use -l to show in full.

三、下载subsonic镜像

[root@jeven ~]#docker pull cyrilix/subsonic
Unable to find image 'cyrilix/subsonic:latest' locally
latest: Pulling from cyrilix/subsonic
c73ab1c6897b: Pull complete 
1ab373b3deae: Pull complete 
b542772b4177: Pull complete 
0bcc3741ab14: Pull complete 
421d624d778d: Pull complete 
26ad58237506: Pull complete 
8dbabc90b2b8: Pull complete 
982930be204d: Pull complete 
80869be51738: Pull complete 
b71ce0f0260c: Pull complete 
b18814a5c704: Pull complete 
444f958494eb: Pull complete 
6f92b6053b75: Pull complete 
a008355a31fd: Pull complete 
f6248f1e863f: Pull complete 
Digest: sha256:7e40c4c48997f956133da3a8aa1a4ca8f31947130d80b0b5ae822f460f740124
Status: Downloaded newer image for cyrilix/subsonic:latest

四、创建subsonic容器

1.创建subsonic容器

docker run \
  -d --name subsonic \
  --publish 8080:8080 \
  --volume "/data/subsnoic/music:/opt/music/:ro" \
   cyrilix/subsonic

2.查看subsonic容器状态


[root@jeven ~]# docker ps
CONTAINER ID   IMAGE              COMMAND                  CREATED          STATUS          PORTS                                           NAMES
069e3a0a7ed0   cyrilix/subsonic   "catalina.sh run"        43 minutes ago   Up 43 minutes   0.0.0.0:8080->8080/tcp, :::8080->8080/tcp       subsonic

3.查看容器subsonic运行日志

[root@jeven ~]# docker logs subsonic 
24-Dec-2022 08:14:31.834 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.30
24-Dec-2022 08:14:31.835 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 3 2018 20:04:09 UTC
24-Dec-2022 08:14:31.835 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.30.0
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-1160.80.1.el7.x86_64
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-8-openjdk-amd64/jre
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_162-8u162-b12-1~deb9u1-b12
24-Dec-2022 08:14:31.836 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.contextPath=/
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.home=/opt/data
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.defaultMusicFolder=/opt/music/
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.defaultPodcastFolder=/opt/podcast/
24-Dec-2022 08:14:31.837 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dsubsonic.defaultPlaylistFolder=/opt/playlist/
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.5.2].
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
24-Dec-2022 08:14:31.838 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
24-Dec-2022 08:14:31.840 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0f  25 May 2017]
24-Dec-2022 08:14:31.889 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
24-Dec-2022 08:14:31.901 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Dec-2022 08:14:31.907 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
24-Dec-2022 08:14:31.908 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
24-Dec-2022 08:14:31.911 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 302 ms
24-Dec-2022 08:14:31.923 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
24-Dec-2022 08:14:31.924 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.30
24-Dec-2022 08:14:31.942 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [/usr/local/tomcat/webapps/ROOT.war]
24-Dec-2022 08:14:49.248 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
24-Dec-2022 08:15:02.019 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/ROOT.war] has finished in [30,076] ms
24-Dec-2022 08:15:02.020 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/docs]
24-Dec-2022 08:15:02.028 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [8] ms
24-Dec-2022 08:15:02.028 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
24-Dec-2022 08:15:02.142 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/examples] has finished in [114] ms
24-Dec-2022 08:15:02.143 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/host-manager]
24-Dec-2022 08:15:02.161 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/host-manager] has finished in [18] ms
24-Dec-2022 08:15:02.161 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/manager]
24-Dec-2022 08:15:02.170 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/manager] has finished in [9] ms
24-Dec-2022 08:15:02.176 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
24-Dec-2022 08:15:02.201 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
24-Dec-2022 08:15:02.242 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 30331 ms

五、访问Subsonic

admin/admin

image.png

image.png

相关文章
|
7天前
|
Kubernetes Cloud Native Docker
云原生时代的容器化实践:Docker和Kubernetes入门
【10月更文挑战第37天】在数字化转型的浪潮中,云原生技术成为企业提升敏捷性和效率的关键。本篇文章将引导读者了解如何利用Docker进行容器化打包及部署,以及Kubernetes集群管理的基础操作,帮助初学者快速入门云原生的世界。通过实际案例分析,我们将深入探讨这些技术在现代IT架构中的应用与影响。
30 2
|
5天前
|
运维 Cloud Native 虚拟化
一文吃透云原生 Docker 容器,建议收藏!
本文深入解析云原生Docker容器技术,涵盖容器与Docker的概念、优势、架构设计及应用场景等,建议收藏。关注【mikechen的互联网架构】,10年+BAT架构经验倾囊相授。
一文吃透云原生 Docker 容器,建议收藏!
|
8天前
|
人工智能 API 数据安全/隐私保护
使用 Docker 一键免费部署 63.8k 的私人 ChatGPT 网页应用
NextChat 是一个可以在 GitHub 上一键免费部署的私人 ChatGPT 网页应用,支持 GPT3、GPT4 和 Gemini Pro 模型。该项目在 GitHub 上获得了 63.8k 的 star 数。部署简单,只需拉取 Docker 镜像并运行容器,设置 API Key 后即可使用。此外,NextChat 还提供了预设角色的面具功能,方便用户快速创建对话。
59 22
使用 Docker 一键免费部署 63.8k 的私人 ChatGPT 网页应用
|
9天前
|
运维 开发者 Docker
Docker Compose:简化容器化应用的部署与管理
Docker Compose:简化容器化应用的部署与管理
|
9天前
|
Docker 微服务 容器
使用Docker Compose实现微服务架构的快速部署
使用Docker Compose实现微服务架构的快速部署
20 1
|
9天前
|
前端开发 开发者 Docker
深入探索Docker Compose:简化多容器应用的部署
深入探索Docker Compose:简化多容器应用的部署
35 0
|
13天前
|
监控 Cloud Native 微服务
云端漫步:探索云原生应用的构建与部署
【10月更文挑战第32天】在数字时代的浪潮中,云原生技术如同一艘航船,承载着企业的梦想驶向未知的海洋。本文将带你领略云原生应用的魅力,从基础概念到实战操作,我们将一步步揭开云原生的神秘面纱,体验它如何简化开发、加速部署,并提升系统的可扩展性与可靠性。让我们一起启航,探索云原生的世界!
|
6天前
|
Cloud Native 安全 数据安全/隐私保护
云原生架构下的微服务治理与挑战####
随着云计算技术的飞速发展,云原生架构以其高效、灵活、可扩展的特性成为现代企业IT架构的首选。本文聚焦于云原生环境下的微服务治理问题,探讨其在促进业务敏捷性的同时所面临的挑战及应对策略。通过分析微服务拆分、服务间通信、故障隔离与恢复等关键环节,本文旨在为读者提供一个关于如何在云原生环境中有效实施微服务治理的全面视角,助力企业在数字化转型的道路上稳健前行。 ####
|
7天前
|
运维 Kubernetes Cloud Native
云原生技术:容器化与微服务架构的完美结合
【10月更文挑战第37天】在数字化转型的浪潮中,云原生技术以其灵活性和高效性成为企业的新宠。本文将深入探讨云原生的核心概念,包括容器化技术和微服务架构,以及它们如何共同推动现代应用的发展。我们将通过实际代码示例,展示如何在Kubernetes集群上部署一个简单的微服务,揭示云原生技术的强大能力和未来潜力。
|
9天前
|
消息中间件 存储 Cloud Native
云原生架构下的数据一致性挑战与应对策略####
本文探讨了在云原生环境中,面对微服务架构的广泛应用,数据一致性问题成为系统设计的核心挑战之一。通过分析云原生环境的特点,阐述了数据不一致性的常见场景及其对业务的影响,并深入讨论了解决这些问题的策略,包括采用分布式事务、事件驱动架构、补偿机制以及利用云平台提供的托管服务等。文章旨在为开发者提供一套系统性的解决方案框架,以应对在动态、分布式的云原生应用中保持数据一致性的复杂性。 ####