NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Docker amd64 v
« Previous 1 2 3 4 5 … 9 Next »
AMD64 based Docker Image with Python3

 
  • 0 Vote(s) - 0 Average
AMD64 based Docker Image with Python3
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#1
2020-01-25, 05:45 PM (This post was last modified: 2023-07-23, 04:14 PM by pkscout.)
AT SOME POINT THE DEFAULT IMAGE STARTING COMING WITH PYTHON3
I'm leaving all this here as a historical artifact mainly.  At some point the default image started shipping with Python3.  As of July 23, 2023 it's Python 3.9.2.  That's a hair out of date, but not horribly so.  I won't be updating the image referenced below any longer.  It's not worth the time to me for a slightly newer version of Python3.

Two things to note.  If you want to install any Python modules, you'll have to install pip3 by doing:
Code:
apt update
apt install python3-pip

No need for sudo, as the image seems to default to the root user.  If you ever update the image, you need to reinstall pip3, but ONLY if you need to install modules again.

Which leads me to the other trick. If youmap the Python userspace to an external volume and then install modules in the userspace, you can avoid having to reinstall your python modules every time you update the image.  To do that, you need to add a line to your Docker run or compose:
Code:
- '/volume1/configs/nextpvr/local:/root/.local'

Then install Python modules using:
Code:
pip install --user <item>


ORIGINAL POST
For anyone who wants to run NPVR5 from a Docker container and also would like to use Python scripts for things like Parallel or Post Processing (or Extra tuners), I've published a Docker container based on nextpvr/nextpvr_amd64Confusedtable.  There are two different ways you can run this Docker.

The stable tag includes NextPVR, Python 3.9.6, and the following modules:
  • requests
  • xmltodict
  • websocket-client
  • opencv-python

These are included so two Python scripts I wrote (trigger.kodiscan and iguana-blaster) will work properly in a NextPVR docker container.

The pub tag includes NextPVR and Python 3.9.6. It is setup so that you can map a directory to user level python module installs and install them outside the Docker container. This provides more flexibility if you want to install other modules but don't want to have to redo it every time the image is updated.

Both tags also includes NTP and a couple options to set the timezone for your container. This was added because on certain platforms Docker containers don't seem to be able to get the time/timezone from the host OS. And having accurate times seems important for a DVR. If your Docker container is getting the time correctly from the Host OS, you don't need to include those options.

There's complete information both options (including sample run commands) at:

https://hub.docker.com/repository/docker...vr-python3

NOTE ABOUT COMSKIP:
With the release of 6.x, the NextPVR image is based on Bullseye.  I can't seem to get any of the current(ish) Comskips to build with this, and the version of Comskip included in the apt package manager for Bullseye is pretty old.  So I DID NOT update the two Comskip tags.  They will remain at the last 5.x version of NextPVR, but may not ever be updated again.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,768
Threads: 954
Joined: May 2006
#2
2020-01-25, 05:52 PM
I made this suggestion to take it from the host https://forums.nextpvr.com/showthread.ph...#pid532506 but your suggestion might be better on a Windows host.

Martin
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#3
2020-01-25, 08:42 PM
(2020-01-25, 05:52 PM)mvallevand Wrote: I made this suggestion to take it from the host https://forums.nextpvr.com/showthread.ph...#pid532506 but your suggestion might be better on a Windows host.

Martin

I wish I could take credit for this, but I found the answer from some internet search at some point, and I now I can't find the original page again to give the author the credit.  Bad me.  But yes, this solution does appear to be platform independent.  The drawback is that you have to know the right timezone text to put in.  Which is also findable on the internet, so I guess there's that.  '-)
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#4
2020-02-09, 12:55 AM
Image has been updated to NextPVR 5.0.1.200209.
dsreyn
Offline

Member

USA
Posts: 66
Threads: 13
Joined: Jan 2020
#5
2020-02-13, 11:36 PM
I'm not sure what you've been doing to inject Python into the container. But I'm wondering if it would be possible to build it in such a way that it could exist in a separate directory structure outside the container's file system, and then be mounted into the docker file system using the --volume option. As I recall, the Python configure scripts usually have a --prefix=[dir] option that can be used to set the install directory to something other than the standard / default location. Then when you get to the "make install" step, everything gets installed under the directory given by --prefix.

The advantage would be that your distribution would then just need to be the subdirectory structure where Python gets installed, not the full container. And you wouldn't need to put together a new distribution every time Sub puts out a new release. Users would just have the Python package unpacked somewhere outside the container, and would just point the new NextPVR release to that location.

Doug
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#6
2020-02-14, 02:21 AM
I'm just using apt-get to install the Python stuff. It takes like 5 extra minutes to build a new container when sub releases one. And the advantage there is that I then get the most current Python builds at the same time. Your suggestion could certainly work, but I'd probably spend quite a lot of time figuring it out, and then I'd have to do at again whenever a Python update comes out.
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#7
2020-03-21, 08:49 PM
Image has been updated to NextPVR v5.0.2.200322. In addition, there is a tagged stable branch now (to match what sub is doing). Instructions in first post have been updated.
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#8
2020-03-22, 04:32 AM (This post was last modified: 2020-03-22, 04:33 AM by pkscout.)
On the off chance anyone is actually using this, I found a problem with the python3 cv2 module.  The stable branch has been updated with the fixes, so if you pulled it between now and 7 hours ago, you need to pull an updated image.
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#9
2020-04-28, 03:32 AM
Image has been updated to NextPVR v5.0.4.200428.
pkscout
Offline

Senior Member

USA
Posts: 464
Threads: 50
Joined: May 2014
#10
2020-07-27, 12:20 AM
Image has been updated to NextPVR 5.0.7.200726.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Comskip segfaults with comskip embedded in amd64 docker SickBoy 6 320 2025-02-24, 11:18 PM
Last Post: SickBoy
Information Custom NPVR image with ffmpeg, ccextractor, handbrake, comskip, etc. Ranbato 66 14,262 2025-01-16, 04:26 AM
Last Post: mvallevand
  Issues with Session Handling Behind Caddy Reverse Proxy in Docker: invalid session user001 5 362 2025-01-10, 08:23 PM
Last Post: sub
  Docker container becomes unresponsive overnight wapkaplet 6 557 2025-01-10, 04:47 PM
Last Post: wapkaplet
  Docker image upgrade ceejayemm 9 795 2025-01-07, 11:27 PM
Last Post: pkscout
  Current guide for NextPVR docker on Unraid? wapkaplet 1 662 2024-12-20, 02:40 AM
Last Post: wapkaplet
  Modification to the NextPVR Image DockerFile thelanofvilles 5 490 2024-12-15, 07:30 PM
Last Post: thelanofvilles
  NextPVR with Docker and Fritzbox icompas 9 565 2024-12-12, 02:50 PM
Last Post: icompas
  Docker postprocessing script aTF6i 12 947 2024-11-17, 01:17 AM
Last Post: aTF6i
  XMLTV folder for Docker stevil 1 374 2024-09-25, 06:56 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode