INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Docker Images for MC30 (current one + a new image with arm builds)  (Read 2051 times)

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358

First docker images for MC30 are available here: https://hub.docker.com/r/shiomax/jrivermc30

If you're upgrading from an older version library backup and restore is required. So, make sure you have a backup.

---

First builds of the new images Iīve been working on for quite some time are available now too: https://hub.docker.com/r/shiomax/jrivermc
Builds are available for mc 29 and 30.

You do not have to change to that image if you are happy with the old one, itīs not going anywhere immediately. At least not for now. Obviously, I do not plan to keep building both indefinitely, but at the very least Iīll not make the cutoff midway threw a cycle of a mc version. So you can wait for at least mc 31, maybe longer. I do not know yet.

If you want to try/use the new image. When changing from the other one, Id recommend creating a new "config" directory. Backup the old one and tread it as a completely new install (restore from mc backup). It probably works if you plonk in the old config directory, but Im not totally sure and not testing for it either.

Quick list of changes
- No longer based on "jlesage/baseimage-gui", but instead based off raw debian
- Builds for arm64 as well as amd64 (note that there are no 32bit images at this time, if you want to use it on a pi you need to use 64bit pi os, changing the kernel to 64bit on a 32bit install will not work).
- New webgui with dark and light mode
- Now using tigervnc instead x11vnc
- Setting authentication works differently, it now forces you to set a username/password combination when you first enter the webgui instead of setting it via VNC_PASSWORD environment variable. As of now you cannot NOT set a username/password. Looking for feedback if somebody actually wants to have no authentication.
- For direct VNC connections there is at this point no authentication setup at all, by default tigervnc listens on a unix sockets (read the documentation on how to change that). Meaning it is by default completely inaccessible from outside the container and you can only use the webgui. Iīve never really used anything but the webgui much, so it wasnīt much of a priority to get that working for the first release. Might look into options on how to deal with that later.
- For the new images all the images are in the same dockerhub repo, so picking a mc version is done with the tags :latest-29, :latest-30, I would not actually recommend you use plain :latest as it will use the absolute latest MC version available at any time, so it would upgrade past mc 30 once that is availabe.
- Some experimentation with MC integration. Currently, the only thing is an option to upload a mjr file. It will stop mc and do all the necessary steps to apply the license file. Might do something else in the future. Im not looking to extend MC functionally, but rather add helpful things for managing the container. Since I now have control over the GUI and everything else that goes into it a lot more things would be possible.
- Partial hardware acceleration. Should work for decoding video, will not work for rendering the virtual desktop. To have hardware acceleration on virtual desktops work something like virtualgl would be required.
- Logs are written to /log into rotating files for relevant services. If might want to mount this folder to a directory too. But itīs not required.
- A "STATELESS_MODE" flag. This will not be useful for most people. On startup this will copy the .jriver folder to a temporary directory and use that to run mc. Meaning if you restart the container whatever you did will be lost/reset. Probably should mount media (if required) as read only then too. The intention would be to be to make it possible to write tests for other software that uses mcws in a repeatable manner
- BLOCK_MC_STARTUP env variable is gone. You should use mcd-stop and mcd-start scripts/commands instead when needed, but probably would not be needed unless for mjr activation which is integrated into the gui, but if you want to do it without the gui use those to stop / start mc.
- KEEP_APP_RUNNING env variable is gone as it does not really make a ton of sence to exit the container when you stop mc
- APP_NICENESS env variable is gone, not sure if itīs needed, I donīt think you should ever have to set it might add it later just in case
- ENABLE_CJK_FONT env variable is gone, the font is installed by default if there are other fonts needed to display your songs just hit me up, fonts arenīt huge it should work out of the box
- X11VNC_EXTRA_OPTS env variable is gone, itīs no longer using x11vnc may add tigervnc options later
- MAXIMIZE_POPUPS env variable is gone, may add something like this back in the future, but i want to test different desktop environments at some point and see if another one works better for mc as with openbox the window sizing is a bit off for some reason. So Iīll think about this after that.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 716
  • Looking Busy
Re: Docker Images for MC30
« Reply #1 on: October 13, 2022, 05:24:05 am »

Hi Max. That link goes to the MC30 image but why is it when I search for it in Docker Hub or thru my Container Station it is not listed?

Thanks

Logged

eve

  • Citizen of the Universe
  • *****
  • Posts: 651
Re: Docker Images for MC30
« Reply #2 on: October 13, 2022, 02:30:55 pm »

Hi Max. That link goes to the MC30 image but why is it when I search for it in Docker Hub or thru my Container Station it is not listed?

Thanks

Yeah doesn't show up on DockerHub searches. Container Station is a QNap thing right?
Can you just create a compose file for 30 on your own? If you need help with writing it just let us know, it's pretty straight forward.



Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 716
  • Looking Busy
Re: Docker Images for MC30
« Reply #3 on: October 13, 2022, 03:59:10 pm »

Thanks Max, yes all good I can do that. And yes CS is the QNAP container app.

Odd that it doesn’t show up in the search though.

Cheers
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: Docker Images for MC30
« Reply #4 on: October 13, 2022, 05:11:43 pm »

Created an issue on dockerhubs issue tracker https://github.com/docker/hub-feedback/issues/2276

This is not exactly something I can control it's up to dockerhub when images get indexed for search.

You should be able to use the image just fine when you type in the image name out manually.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 716
  • Looking Busy
Re: Docker Images for MC30
« Reply #5 on: October 13, 2022, 06:25:46 pm »

Yep understood thanks Max. Appreciate your work on the Container version.
Logged

Richard Martin

  • World Citizen
  • ***
  • Posts: 227
Re: Docker Images for MC30
« Reply #6 on: October 15, 2022, 03:25:30 pm »

I couldn't find it searching from the docker app on my Synology NAS, but that also allows you to enter the URL.  Doing that worked and I have 30 up and running.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 716
  • Looking Busy
Re: Docker Images for MC30
« Reply #7 on: October 18, 2022, 03:52:04 pm »

Looks as if this is resolved Max, your MC30 image now showing up in searches.
Logged

res80

  • Recent member
  • *
  • Posts: 30
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #8 on: December 31, 2022, 03:41:00 pm »

Thanks for those excellent docker images, makes running MC even easier than before (running bare metal).
But I ran into one problem:
I am using nginx as reverse proxy for all my browser-based applications.
E.g. JRiver panel is accessible via https://music.mydomain.com, using letsencrypt certificates.
Nginx and letsencrypt are running directly on the host server, no docker involved. Docker is running in network host mode, so no port rules have to be defined.
However, when I tried to the WebGUI to https://music.mydomain.com/admin/, webgui is not working.
I can see the novnc status bar on top, but next to the title it shows loading for a while and then failed.
Internal access with machine.local:5800 works ok, even from different machines within the same LAN, so no firewall issue?
Any ideas?
Thanks a lot,
Ruediger
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #9 on: December 31, 2022, 08:58:47 pm »

Websockify runs over a websocket connection not http so you need a seperate block for that with different settings to have novnc work.

This is the nginx http config the new images are using.

https://gitlab.com/shiomax/jrivermc-docker-next/-/blob/main/rootfs/etc/nginx/sites-available/http_config

Hope that helps. i think replacing the / block with the contents of /api (you should be able to merge the two) and replacing the urls with the container ip should give you a working base config you can add your cert to.

Not sure about the other image right off the bat. Gotta dig up where jlesage put websockify in the base image. Can try to get it working when I get home tomorrow but I think you can probably figure that out too since it sounds like you otherwise already know your way around nginx. You should also see the url pop up in your browsers debug window in the networking tab. Might very well also be /websockify but im not sure right now.
Logged

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #10 on: January 01, 2023, 06:00:45 am »

Thank you again Max for continuing to keep the docker image of MC up to date.  I just wish to know if there will be the option to authenticate the Last.FM service down the line?  For me it's the last remaining feature yet to be implemented in the Docker version of MC.  It's a niche request so forgive me for requesting it.  Thanks again for the consideration!  I hope you have a great start to your new year! 
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #11 on: January 01, 2023, 05:40:44 pm »

Thank you again Max for continuing to keep the docker image of MC up to date.  I just wish to know if there will be the option to authenticate the Last.FM service down the line?  For me it's the last remaining feature yet to be implemented in the Docker version of MC.  It's a niche request so forgive me for requesting it.  Thanks again for the consideration!  I hope you have a great start to your new year!

I think you can edit this file "~/.jriver/Media Center 30/Settings/User Settings.ini" and fill out "Last.fm - Session Key" "Last.fm - Username" in the container under "/config/.jriver/Media Center 30/Settings/User Settings.ini" with what you got after logging in on another mc instance where it works.

Code: [Select]
Last.fm - Session Key="<Your Session Key>"
Last.fm - Subscriber=i:"0"
Last.fm - Username="<Your Username>"

Installing a standalone browser isnīt quite enough. It works for other stuff like the twitter connect thing and the last fm profile (once there is something configured) but it does not for connecting with last fm. Appears to be working for me by manually editing the file, however it does not work over media network it only works if you actually play files with that docker container (which is probably how that feature is supposed to work though).
Logged

Afrosheen

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 313
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #12 on: January 02, 2023, 02:24:28 pm »

Thank you max!  I'll check it out when I get the chance to dive deep into this! 

I am using nginx as reverse proxy for all my browser-based applications.
E.g. JRiver panel is accessible via https://music.mydomain.com, using letsencrypt certificates.
Nginx and letsencrypt are running directly on the host server, no docker involved. Docker is running in network host mode, so no port rules have to be defined.

After reading this, I'm intrigued at getting nginx for https support, and am wondering if you could point me at how you got started.  Would you know of any good places that would provide a tutorial on setting this up on a NAS?
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #13 on: January 03, 2023, 01:14:13 pm »

Thanks for those excellent docker images, makes running MC even easier than before (running bare metal).
But I ran into one problem:
I am using nginx as reverse proxy for all my browser-based applications.
E.g. JRiver panel is accessible via https://music.mydomain.com, using letsencrypt certificates.
Nginx and letsencrypt are running directly on the host server, no docker involved. Docker is running in network host mode, so no port rules have to be defined.
However, when I tried to the WebGUI to https://music.mydomain.com/admin/, webgui is not working.
I can see the novnc status bar on top, but next to the title it shows loading for a while and then failed.
Internal access with machine.local:5800 works ok, even from different machines within the same LAN, so no firewall issue?
Any ideas?
Thanks a lot,
Ruediger

Tried it now using this configuration it works fine.

Code: [Select]
upstream mediacenter {
  # Docker container running mediacenter
  server 127.0.0.1:5800;
}

# Redirect HTTP connections to HTTPS
#server {
#    listen       80;
#    listen  [::]:80;

#    return 301 https://$host$request_uri;
#}

server {
    listen 443 ssl;

    ssl_certificate /path/to/cert;
    ssl_certificate_key /path/to/private_key;

    location / {
        proxy_pass http://mediacenter;
        proxy_http_version 1.1;
    }

    location /api {
        proxy_pass http://mediacenter;
        proxy_http_version 1.1;
        proxy_set_header Upgraded $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /websockify {
        proxy_pass http://mediacenter;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;

        # VNC connection timeout
        proxy_read_timeout 61s;

        # Disable cache
        proxy_buffering off;
    }
}
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #14 on: January 03, 2023, 03:31:11 pm »

After reading this, I'm intrigued at getting nginx for https support, and am wondering if you could point me at how you got started.  Would you know of any good places that would provide a tutorial on setting this up on a NAS?

If you just want to have SSL for this container itīs enough to set SECURE_CONNECTION to 1. If you want to setup a common reverse proxy to put multiple services behind and manage SSL certs centrally then you gotta setup your own.

There are plenty of guides out there on how to do this in detail. But tldr; you can either, like the container does generate a self signed certificate (works for domain names you made up or IPs) or you can purchase a domain name and then lets encrypt can issue you a trusted certificate for free for said domain. Letsencrypt has made a tool they named certbot that you should run on a schedule as the lifetime of the certificates they give you is only 3 months. Use a similar NGINX config as the one above. If you wanna generate a self signed cert you can use a command such as this.

Code: [Select]
openssl req \
        -x509 \
        -nodes \
        -days 365 \
        -newkey rsa:2048 \
        -subj "/C=CA/O=example.com/OU=Home/CN=noreply.example.com" \
        -keyout $CERT_DIR/privkey.pem \
        -out $CERT_DIR/fullchain.pem

Like I said it really should not be hard to find a lot of guides about this everywhere that go into a lot more detail. I donīt have a specific one to recommend though. The digitalocean guides are quite good https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-debian-11. But Iīm not sure they are if you are unfamiliar with the subject since Iīve done this before and I just donīt read any of the guides anymore about this. I do go there sometimes, but just use them as a cheatsheet to copy the commands I know I need. Their DNS servers are also free of charge with great UI, with an API with great documentation. So, if you did not get access to one with your domain purchase, or donīt like it then you can use theirs.
Logged

res80

  • Recent member
  • *
  • Posts: 30
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #15 on: January 03, 2023, 04:39:59 pm »

Tried it now using this configuration it works fine.

Code: [Select]
upstream mediacenter {
  # Docker container running mediacenter
  server 127.0.0.1:5800;
}

# Redirect HTTP connections to HTTPS
#server {
#    listen       80;
#    listen  [::]:80;

#    return 301 https://$host$request_uri;
#}

server {
    listen 443 ssl;

    ssl_certificate /path/to/cert;
    ssl_certificate_key /path/to/private_key;

    location / {
        proxy_pass http://mediacenter;
        proxy_http_version 1.1;
    }

    location /api {
        proxy_pass http://mediacenter;
        proxy_http_version 1.1;
        proxy_set_header Upgraded $http_upgrade;
        proxy_set_header Connection keep-alive;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /websockify {
        proxy_pass http://mediacenter;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;

        # VNC connection timeout
        proxy_read_timeout 61s;

        # Disable cache
        proxy_buffering off;
    }
}

Thank you so much for the hints.
However, I would like to run the novnc on a subfolder, not root of my sudomain.
So instead of "/", it would be "/admin" in my case.
Should I change "/api" to "/admin/api" then?
Sorry, not sure about that entirely...
Thanks,
Ruediger
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #16 on: January 03, 2023, 07:12:24 pm »

Thank you so much for the hints.
However, I would like to run the novnc on a subfolder, not root of my sudomain.
So instead of "/", it would be "/admin" in my case.
Should I change "/api" to "/admin/api" then?
Sorry, not sure about that entirely...
Thanks,
Ruediger

Don't think that would entirely work right now. The webapp determines the urls by taking the base url and adding /api and /websockify to them (when it runs in your browser so your nginx config won't affect that). There may be other issues too. Never tested it for that. You can make a subdomain like mc.mydomain.com or vnc.mydomain.com.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 716
  • Looking Busy
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #17 on: January 16, 2023, 08:10:42 pm »

Question for Max, how do I get the Docker image to recognise an external USB DVD drive?

My QNAP picks it up and gives the disc a volume name, I'm assuming I can pass this through to the image?

Thanks
Logged

max096

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 358
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #18 on: January 17, 2023, 05:59:43 am »

Question for Max, how do I get the Docker image to recognise an external USB DVD drive?

My QNAP picks it up and gives the disc a volume name, I'm assuming I can pass this through to the image?

Thanks

Try adding /dev/sr0 to the devices similar how it explains it for /dev/snd in the docs though ive never tried and there is currently no script that adds the group to the mc user like there is for /dev/snd. So you might not have access to it in the container without manually changing permissions.

If the device belongs to a group on your QNAP you can just add the group id to SUP_GROUP_IDS.

---

Just tried it works just fine. On your QNAP check what group /dev/sr0 belongs to

Code: [Select]
max@fax:~ $ ls -la /dev/sr0
brw-rw----+ 1 root cdrom 11, 0 Jan 17 19:20 /dev/sr0

Then get the group id for the group name it spits out.

Code: [Select]
max@fax:~ $ cat /etc/group | grep cdrom
cdrom:x:11:

Then if you're using compose you can add this

Code: [Select]
version: '3'
services:
  jrivermc:
    .
    .
    environment:
        - SUP_GROUP_IDS=11
    devices:
        - /dev/sr0

Or for docker run add these "--device /dev/sr0 -e SUP_GROUP_IDS=11"

If you have multiple cdrom drives you can remap any of them to /dev/sr0 in the container like this "/dev/sr1:/dev/sr0". The mc changelogs say it will only look for /dev/sr0 specifically so I think you have to remap it if you want to use another disk drive.

I'll be adding something in the next version that adds the group id automatically on startup for /dev/sr0 similarly to how it already works for /dev/snd. Then it will be enough to just map the device.
Logged

Scobie

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 716
  • Looking Busy
Re: Docker Images for MC30 (current one + a new image with arm builds)
« Reply #19 on: January 17, 2023, 04:55:53 pm »

Brilliant will give that a try (or just fumble about til your next release...!) , thanks Max.
Logged
Pages: [1]   Go Up