Skip to content

Update Dev Container setup with SoftSqueeze support#1552

Open
mipa87 wants to merge 5 commits into
LMS-Community:public/9.2from
mipa87:devContainer
Open

Update Dev Container setup with SoftSqueeze support#1552
mipa87 wants to merge 5 commits into
LMS-Community:public/9.2from
mipa87:devContainer

Conversation

@mipa87
Copy link
Copy Markdown
Contributor

@mipa87 mipa87 commented Apr 6, 2026

  • Updated devcontainer.json to include environment variables and commands for initialization and startup.
  • Configured editor settings and added necessary files for Perl Language Server integration.
  • Developed a standalone SoftSqueeze container with VNC support, including entrypoint and management scripts.
  • Added initialization script to create a shared network for containers.
  • Implemented post-create and post-start scripts for LMS setup and auto-start functionality.
  • Introduced a clean-up script to remove runtime-generated folders.
  • Enhanced documentation for Dev Container usage, SoftSqueeze setup, and troubleshooting.

Everything has been tested - Docker Compose and Dockerfile, GitHub Codespaces and Dev Containers, Podman (Docker should be compatible) — on both Windows and GitHub Codespaces on Linux.

I hope this makes development easier for new Perl developers like me 🙂

image image

Comment thread .vscode/PerlLanguageServerBootstrap.pm
@michaelherger
Copy link
Copy Markdown
Member

Thanks! I had seen your branch and it intrigued me. I never really used dev containers, and running them on Github directly showed quite a few limitations with a free account. But this should still be a good addition.

Before I go into great details: why Softsqueeze, but no squeezelite of Squeezeplay? I believe the latter are way more popular (and important nowadays) than the former.

@mipa87
Copy link
Copy Markdown
Contributor Author

mipa87 commented Apr 6, 2026

The advantage of Dev Containers is that you don't need any additional tools for local development—everything is included in a single "package."

Yes, you’re right, SoftSqueeze isn’t popular anymore, but I’m working on an improvement regarding bitmap fonts, and SoftSqueeze is perfect for that. And I didn’t want to install it locally. I can set up other containers, but there are certainly sound issues, especially when the host is Windows.

Comment thread .devcontainer/softsqueeze/SOFTSQUEEZE.md
Copy link
Copy Markdown
Member

@michaelherger michaelherger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I will definitely have to give this a try! I've never been able to debug LMS... this would be a first.

Maybe you could add a section to DEVCONTAIERS.md explaining how to map a music folder to the container? Or did I miss that?

Comment thread DEVCONTAINERS.md Outdated
Comment on lines +120 to +122
- `Cache/`
- `Logs/`
- `prefs/`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would these folders live in the clone's root? Any way to move this elsewhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is possible to mount this paths as volume. I can add this as option to the image

Copy link
Copy Markdown
Contributor Author

@mipa87 mipa87 May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on what you want—whether to use the project's root directory or something else. I prefer the project's root directory, which is slimserver's default behavior.

Comment thread .devcontainer/clean-folders.sh Outdated
cd "$REPO_ROOT"

if [[ "$FORCE" != "1" ]]; then
echo "[INFO] This will delete: ${FOLDERS_TO_CLEAN[*]}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to show the full list. Just to not get nervous about it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll do that

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment thread .devcontainer/devcontainer.json
Comment thread .devcontainer/devcontainer.json Outdated
Comment on lines +83 to +84
"/workspaces/slimserver/CPAN/arch/5.40/x86_64-linux-thread-multi",
"/workspaces/slimserver/CPAN/arch/5.40/x86_64-linux-thread-multi/auto",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be made platform independent? I'm a Mac user...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give it a try. I was worried it wouldn't work for everyone, but I don't have a way to test it—I'm on Windows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, you can try.

Comment thread .gitattributes Outdated
@@ -0,0 +1,2 @@
# Normalize all text files to LF in this repository (fix issues with line endings with Dev Containers on Windows)
* text=auto eol=lf
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this cause any file change to change line endings, potentially "modifying" a full name just for the line endings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the definition; after that, we can run this script and see what changes

git add --renormalize .
git status

Copy link
Copy Markdown
Contributor Author

@mipa87 mipa87 May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following files will be modified:

  • Firmware/receiver.version
  • Graphics/CODE2000.HTM
  • HTML/EN/html/ext/ext-all-debug.js
  • Slim/Plugin/CLI/Settings.pm
  • Slim/Plugin/DateTime/Settings.pm
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/customtags.html
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/httpprotocol.html
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/powersearch.html
  • Slim/Plugin/MusicMagic/HTML/EN/plugins/MusicMagic/html/docs/powerwords.html
  • Slim/Plugin/Podcast/ProtocolHandler.pm
  • Slim/Plugin/Podcast/Settings.pm
  • Slim/Plugin/RS232/Settings.pm
  • Slim/Plugin/Rescan/Settings.pm
  • Slim/Plugin/UPnP/HTML/EN/plugins/UPnP/MediaServer/MediaReceiverRegistrar.xml
  • Slim/Plugin/iTunes/Settings.pm
  • Slim/Plugin/xPL/Settings.pm

Is this okay, or should I add some exceptions to the .gitattributes file?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this! I think I could live with this list of files being changed. Would that happen with this PR, or the first time they'd be touched?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, it would be a good idea to add these files to this PR. Those files would only be affected the first time someone explicitly runs git add --renormalize. after pulling the .gitattributes change — existing checkouts won't be silently modified

@michaelherger
Copy link
Copy Markdown
Member

michaelherger commented Apr 8, 2026

First attempt failed. Trying to run using F5 would bring up the debug panel, but no output whatsoever. And after a second or two it stops. Might be the platform is an issue here?

vscode ➜ /workspaces/git/platforms (public/9.2) $ perl -v
This is perl 5, version 32, subversion 1 (v5.32.1) built for aarch64-linux-gnu-thread-multi

The container was created for ARM (Apple Silicon). I tried tweaking all x86_64 paths to use the aarch64 version instead. But still: no feedback, no LMS running.

Then tried to run LMS manually (inside the container):

vscode ➜ /workspaces/git/server (devContainer) $ perl slimserver.pl 
[26-04-08 06:34:16.1322] main::init (282) Starting Lyrion Music Server (v9.2.0, git-40b56d906, 2026-04-06 02:22:50 +0200) perl 5.032001 - aarch64-linux-gnu-thread-multi
[26-04-08 06:34:16.7947] main::init (555) Server done init: http://172.17.0.2:9000
[26-04-08 06:34:16.8250] Slim::Utils::Misc::msg (1346) Warning: [06:34:16.8248] Async::HTTP: Unable to load IO::Socket::SSL, will try connecting to SSL servers in non-SSL mode

Would probably be good to add IO::Socket::SSL too?

@mipa87
Copy link
Copy Markdown
Contributor Author

mipa87 commented Apr 8, 2026

It must be challenging to develop without debugging.

Yes, the "issue" is the platform. I'll try to fix it, but I don't have a way to test it, so it's good that you have a Mac.

I'll also add the music paths as volume mount.

@mipa87
Copy link
Copy Markdown
Contributor Author

mipa87 commented Apr 19, 2026

Updated—I hope it works for you too.

Comment thread .editorconfig
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something about this configuration file must be wrong/incomplete: after I had tried out your PR my indenting was set to spaces all over the place. Not in VSCode, but something overrode the setting I have in VSCode. All my existing code which was using tabs before (incl. LMS) suddenly started using spaces. Did this not happen to you?

Copy link
Copy Markdown
Contributor Author

@mipa87 mipa87 May 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the "editorconfig.editorconfig" extension has been installed (see .vscode/extensions.json), so every project you open uses this extension? The files are formatted correctly in the LMS, right?

Comment thread .gitignore
Comment thread .devcontainer/clean-folders.sh Outdated
@mipa87 mipa87 requested a review from michaelherger May 9, 2026 19:23
mipa87 added 3 commits May 10, 2026 11:03
- Updated devcontainer.json to include environment variables and commands for initialization and startup.
- Configured editor settings and added necessary files for Perl Language Server integration.
- Developed a standalone SoftSqueeze container with VNC support, including entrypoint and management scripts.
- Added initialization script to create a shared network for containers.
- Implemented post-create and post-start scripts for LMS setup and auto-start functionality.
- Introduced a clean-up script to remove runtime-generated folders.
- Enhanced documentation for Dev Container usage, SoftSqueeze setup, and troubleshooting.

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
- Updated Dockerfile to include necessary packages and environment variables.
- Improved clean-folders.sh to provide clearer output on folder deletion.
- Modified devcontainer.json to include optional mounts for host folders.
- Added engine-utils.sh for better container engine detection.
- Refactored initialize.sh to utilize engine-utils for container engine selection.
- Updated post-start.sh to execute a new start-lyrion.sh script for starting LMS.
- Enhanced SOFTSQUEEZE.md with clearer instructions and tips for SoftSqueeze usage.
- Improved softsqueeze.sh to support both podman and docker with compose.
- Created start-lyrion.sh for streamlined LMS startup process.
- Updated .gitattributes and .gitignore for better file handling.
- Refined PerlLanguageServerBootstrap.pm for improved module loading.
- Updated extensions.json and launch.json for better VS Code integration.
- Enhanced DEVCONTAINERS.md with clearer instructions for running and stopping Lyrion.

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
…and enhance documentation

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
Comment thread DEVCONTAINERS.md

For Podman, set [`dev.containers.dockerPath`](vscode://settings/dev.containers.dockerPath) to `podman`, and set [`dev.containers.dockerComposePath`](vscode://settings/dev.containers.dockerComposePath) to `podman compose`.

> [!TIP]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mention WSL but don't say whether this was Windows specific. Is it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Clarified that the WSL memory tip is Windows-specific — it no longer sounds like it applies to everyone.

Comment thread DEVCONTAINERS.md
Comment on lines +67 to +77
```bash
bash .devcontainer/start-lyrion.sh
```

The script waits until Lyrion is reachable and prints the URL.

Alternatively, start it directly with Perl:

```bash
perl slimserver.pl
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer to run directly so I immediately have the log output in the console. AND it supports an IMHO super helpful feature for CLI interaction: if you set an environment variable LMS_STDIO=1 you'll be able to directly type CLI commands in the console while LMS is run directly. I like to use that when working on those commands and queries. Maybe that's worth a note?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tip, I wasn't aware of that! Added a note right under the direct perl slimserver.pl launch option — it now mentions LMS_STDIO=1 and the interactive CLI feature. Thanks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh... just checked. Must be one of the most useful und non-documented features we have (for developers). I should add a note to the web site, too.

Comment thread DEVCONTAINERS.md
Comment on lines +79 to +80
4. Open the **Ports** tab and click the **Forwarded Address** `Web interface` to access Lyrion web UI [^2].
[^2]: For local Dev Containers you can also open [http://localhost:9000](http://localhost:9000) directly.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In VSC the printed link is clickable. So that's nice.

Unfortunately I'm hitting permissions issues:

[26-05-11 07:33:24.9826] Slim::Web::Template::SkinManager::_fillTemplate (351) Error: file error - cache failed to write bd362145801a53228f4dab32cd311917: Error in tempfile() using /workspaces/git/server/Cache/templates/XXXXXXXXXX: Parent directory (/workspaces/git/server/Cache/templates/) is not writable

That's just one example. I don't even find a libarary.db. Could this (again) be a macOS issue? That's to first say: thanks! Yes, the dev container now does run on macOS. But unfortunately there's probably more to tweak...

drwxr-xr-x 1 503 dialout     288 May 11 07:34 prefs

Interestingly the same permissions seem to be fine for Logs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added mkdir -p Cache Logs prefs to post-create.sh, which runs inside the container immediately after creation (as the container user). This ensures the runtime directories are owned by the right user before LMS ever tries to write to them.

Regarding the path /workspaces/git/server — that looks like you might be using "Clone Repository in Container Volume", which places the repo under a slightly different path. The "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}" in devcontainer.json should resolve correctly regardless of the folder name. Let me know if the permissions issue persists!

Comment thread DEVCONTAINERS.md Outdated
### Manual Stop

```bash
bash .devcontainer/stop-lyrion.sh
Copy link
Copy Markdown
Member

@michaelherger michaelherger May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably another macOS issue: most scripts don't have executable flag set.

vscode ➜ /workspaces/git/server $ ls -l .devcontainer/
total 44
-rw-r--r-- 1 503 dialout 1430 May 11 07:28 Dockerfile
-rw-r--r-- 1 503 dialout  853 May 11 07:28 clean-folders.sh
-rw-r--r-- 1 503 dialout 3988 May 11 07:28 devcontainer.json
-rw-r--r-- 1 503 dialout  482 May 11 07:27 docker-compose.yml
-rw-r--r-- 1 503 dialout 2091 May 11 07:27 engine-utils.sh
-rw-r--r-- 1 503 dialout  907 May 11 07:27 initialize.sh
-rwxr-xr-x 1 503 dialout  966 May 11 07:27 post-create.sh
-rw-r--r-- 1 503 dialout  338 May 11 07:27 post-start.sh
drwxr-xr-x 1 503 dialout  224 May 11 07:27 softsqueeze
-rw-r--r-- 1 503 dialout 1235 May 11 07:28 start-lyrion.sh
-rw-r--r-- 1 503 dialout  717 May 11 07:27 stop-lyrion.sh

Wouldn't it be possible to fix that so we don't have to use bash explicitly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed! Set the executable bit on all .sh scripts via git update-index --chmod=+x — they were all 100644. You can now run them directly without the bash prefix, and I've updated the docs accordingly.

I've also added a find .devcontainer -name "*.sh" -exec chmod +x {} + fallback to post-create.sh as a safety net for any checkout where the bit gets lost, and added a short note to the docs: for any new scripts added to .devcontainer/, the bit needs to be set explicitly with git update-index --chmod=+x.

Copy link
Copy Markdown
Member

@michaelherger michaelherger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry for the long delay. Had some "life issues" to deal with 😁. And your PR is a lot of work which deserves attention! As you had seen from my earlier attempts, I never really made the concept work. You're much closer already!

In a previous comment I mentioned permissions issues. But I believe out of the box it's even worse: LMS wouldn't start at all if the three working folders didn't exist yet:

vscode ➜ /workspaces/git/server $ perl slimserver.pl 
[26-05-11 07:47:24.8135] main::init (282) Starting Lyrion Music Server (v9.2.0, TRUNK, UNKNOWN) perl 5.032001 - aarch64-linux-gnu-thread-multi
[26-05-11 07:47:24.8143] Slim::Utils::Prefs::init (295) Error: unable to write to preferences directory /workspaces/git/server/prefs
cannot remove directory for /tmp/build-features-src: Operation not permitted at /workspaces/git/server/Slim/Utils/Misc.pm line 660.
cannot unlink file for /tmp/dev-container-features/devcontainer-features.builtin.env: Permission denied at /workspaces/git/server/Slim/Utils/Misc.pm line 660.
cannot restore permissions to 0100755 for /tmp/dev-container-features/devcontainer-features.builtin.env: Permission denied at /workspaces/git/server/Slim/Utils/Misc.pm line 660.
cannot remove directory for /tmp/dev-container-features: Operation not permitted at /workspaces/git/server/Slim/Utils/Misc.pm line 660.
[26-05-11 07:47:24.8979] Slim::Utils::PluginDownloader::init (59) unable to store downloads in cachedir
[26-05-11 07:47:25.2865] YAML::XS::DumpFile (31) Warning: Can't open '/plugin-data.yaml' for output:
Permission denied at /workspaces/git/server/CPAN/YAML/XS.pm line 31.

That's the biggest bummer for me right now. The other one I noticed (when it was somewhat running) was the lack of IO::Socket::SSL support? I don't get it, as should be installed by the Dockerfile definition? Is there a way to for me to see the output of that container creation?

I'll play around some more. Hopefully I'll find some answers, too. Nice work!

mipa87 added 2 commits May 11, 2026 23:55
…entation for script usage

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
…cpanm

Signed-off-by: mipa87 <62723159+mipa87@users.noreply.github.com>
@mipa87
Copy link
Copy Markdown
Contributor Author

mipa87 commented May 11, 2026

No worries at all — take your time! 🙂 And thanks for actually testing on macOS/Apple Silicon, that's invaluable.

Let me go through the issues:

The prefs directory problem is now fixed — post-create.sh creates Cache/, Logs/, and prefs/ right after the container starts (as the container user, so ownership is correct). Please rebuild the container and it should be fine.

The /tmp/build-features-src and /tmp/dev-container-features errors are harmless noise. LMS's cleanup routine in Slim::Utils::Misc tries to remove its own temp files and stumbles on those root-owned devcontainer artifacts in /tmp. They don't affect LMS functionality — it's just a bit alarming to look at.

I've moved libio-socket-ssl-perl and libnet-ssleay-perl to a separate apt step after cpanm, so the Debian packages always win. Please rebuild the container and check whether the warning is gone.

Thanks again for the patience and the detailed feedback, it really helps!

@mipa87 mipa87 requested a review from michaelherger May 11, 2026 22:37
@michaelherger
Copy link
Copy Markdown
Member

Thanks for the updates! Unfortunately my main concerns still aren't fixed: permissions and SSL. I don't get it. I deleted containers/images before pulling the latest changes. I saw it re-build them when I first tried to switch to devcontainer mode. Cache/Logs/prefs folders were re-built, and partially populated: I see .db files in cache and prefs, log.conf, server.log etc. Alas, no prefs files are written, with the same error I mentioned yesterday. Also the templating engine fails put rendered stuff in its Cache/templates folder. But oddly enough I see messages about these failures in Logs/server.log - which means that this file like some others still can be written.

Permissions IMHO are about the same everywhere, with the user ID being 503 (my host user's).

We have code in LMS which would try to lower the user level if run as root. Maybe this is the culprit here: some of the logging/DB/etc. infrastructure is initialised before that, but prefs aren't? Is the server run as root inside the container?

FWIW: I'm using the Colima runtime, rather than Docker (https://github.com/abiosoft/colima). I don't know whether that matters, tbh. But I've never had these kinds of issues with the few containers I'm usually running on that machine.

What do you think? Should we merge anyway, and see what others' experience is? Rather than stress this potentially somewhat exotic setup I'm using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants