Docker changes?

Support for Ubuntu and other Desktop Linux distributions
Post Reply
edifus
Posts: 15
Joined: 01 Sep 2016, 19:36

Docker changes?

Post by edifus »

I just rebuilt my filebot-watcher container because there was some issues with show detection. I have typically tweaked the filebot watcher script and built my own container based off the github repo. However now it seems there was some fundamental changes to the container and filebot now refuses to run as the right user.

If I use the PUID/PGID, the container will run but shows running as root user still when I use the "sysinfo" script.

Code: Select all

❱ docker exec -it filebot-tv filebot -script fn:sysinfo
Oct 17, 2021 5:30:40 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
FileBot 4.9.4 (r8736)
JNA Native: 5.2.2
MediaInfo: 19.09
Tools: fpcalc/1.4.3 p7zip/16.02 unrar/5.61
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2021-08-02 (r761)
Groovy: 3.0.8
JRE: OpenJDK Runtime Environment 11.0.11
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 16 Core / 16 GB Max Memory / 41 MB Used Memory
OS: Linux (amd64)
HW: Linux 1a2a16679edb 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
CPU/MEM: Intel(R) Xeon(R) E-2288G CPU @ 3.70GHz [MemTotal: 67 GB | MemFree: 9 GB | MemAvailable: 44 GB | SwapCached: 394 MB | SwapTotal: 8 GB | SwapFree: 6 GB]
STORAGE: overlay [/] @ 705 GB | xfs [/data] @ 705 GB | xfs [/seedbox] @ 4.2 TB | xfs [/config] @ 705 GB | xfs [/logs] @ 705 GB
USER: root
DATA: /data
Package: DOCKER
License: FileBot License ***** (Valid-Until: 2069-11-19)
Done ヾ(@⌒ー⌒@)ノ

If I try to use docker "user" I get errors when the container initializes and the folder watch never starts -

Code: Select all

❱ docker logs filebot-tv                               
sudo: you do not exist in the passwd database
sudo: you do not exist in the passwd database
sudo: you do not exist in the passwd database
...
sudo: you do not exist in the passwd database
sudo: you do not exist in the passwd database
sudo: you do not exist in the passwd database
I've tried with both PUID/PGID and user, Iv'e tried with just docker user, I've tried with just the PUID/PGID env variables. The container will not start using docker user options and when using PUID/PGID variables sysinfo shows the USER line as "root" and not the correct user.
edifus
Posts: 15
Joined: 01 Sep 2016, 19:36

Re: Docker changes?

Post by edifus »

Actually figured out why sysinfo shows the wrong user - need to run filebot with the new /opt/bin/run-as-user script.

Code: Select all

docker exec -it filebot-tv /opt/bin/run-as-user filebot -script fn:sysinfo
Still trying to figure out why the container refuses to start if I have "user: 1000:1000" in the compose file.
edifus
Posts: 15
Joined: 01 Sep 2016, 19:36

Re: Docker changes?

Post by edifus »

Watch container is now failing to find a license - even when it shows that its licensed. The inotifywait script found a file and triggered filebot but then it just errors out that it's unlicensed.

Code: Select all

❱ docker exec -it filebot-tv /opt/bin/run-as-user filebot -script fn:sysinfo
FileBot 4.9.4 (r8736)
JNA Native: 5.2.2
MediaInfo: 19.09
Tools: fpcalc/1.4.3 p7zip/16.02 unrar/5.61
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2021-08-02 (r761)
Groovy: 3.0.8
JRE: OpenJDK Runtime Environment 11.0.11
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 16 Core / 16 GB Max Memory / 46 MB Used Memory
OS: Linux (amd64)
HW: Linux 01833f53f8da 5.11.0-37-generic #41~20.04.2-Ubuntu SMP Fri Sep 24 09:06:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
CPU/MEM: Intel(R) Xeon(R) E-2288G CPU @ 3.70GHz [MemTotal: 67 GB | MemFree: 10 GB | MemAvailable: 44 GB | SwapCached: 397 MB | SwapTotal: 8 GB | SwapFree: 6 GB]
STORAGE: overlay [/] @ 705 GB | xfs [/data] @ 705 GB | xfs [/seedbox] @ 4.2 TB | xfs [/logs] @ 705 GB | xfs [/config] @ 705 GB
USER: filebot
DATA: /data/filebot
Package: DOCKER
License: FileBot License * (Valid-Until: 2069-11-19)
Done ヾ(@⌒ー⌒@)ノ

Code: Select all

Whoopsies! --action HARDLINK requires a valid license.
* Consider using --action TEST
License Error: UNREGISTERED
 ________________________________________________ 
/ Please purchase a FileBot License:             \
\ https://www.filebot.net/purchase.html#docker   /
 ------------------------------------------------ 
      \                             .       .
       \                           / `.   .' " 
        \                  .---.  <    > <    >  .---.
         \                 |    \  \ - ~ ~ - /  /    |
               _____          ..-~             ~-..-~
              |     |   \~~~\.'                    `./~~~/
             ---------   \__/                        \__/
            .'  O    \     /               /       \  " 
           (_____,    `._.'               |         }  \/~~~/
            `----.          /       }     |        /    \__/
                  `-.      |       /      |       /      `. ,~~|
                      ~-.__|      /_ - ~ ^|      /- _      `..-'   
                           |     /        |     /     ~-.     `-. _  _  _
                           |_____|        |_____|         ~ - . _ _ _ _ _>
FileBot requires a valid license. Please run `filebot --license *.psm` to install your FileBot license.

When I run filebot in the container, it uses /data/filebot as the data path. When filebot is ran from the watcher script, it is using /data as its data directory.

Code: Select all

Initialize Cache folder: /data/filebot/cache
Initialize Logs folder: /data/filebot/logs
Initialize TemporaryFiles folder: /data/filebot/tmp
Initialize new disk cache: /data/filebot/cache/0

vs

Code: Select all

Initialize Cache folder: /data/cache
Initialize TemporaryFiles folder: /data/tmp
Initialize new disk cache: /data/cache/0
Run script [fn:amc] at [Sun Oct 17 18:13:38 GMT 2021]
User avatar
rednoah
The Source
Posts: 22899
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Docker changes?

Post by rednoah »

The latest changes will respect your PUID and PGID environment variables, and run filebot as normal user.


:idea: You can use PUID=0 to run as root to restore the previous run-everything-as-root default behaviour instead of the new run-as-PUID-user by default behaviour:
https://github.com/filebot/filebot-dock ... as-user#L5


:idea: If you use docker exec will run your command as root, which could be any command, e.g. bash, filebot, run-as-user, etc. The standard way of running a docker container is docker run which executes the ENTRYPOINT specified in the dockerfile. Notably, PUID and PGID are not docker features, and docker will run everything as root, unless the container-specific ENTRYPOINT that is always started as root decides to switch to a different less privileged user of it's own volition.


:idea: If you run as root, then $HOME will be set to /data. However, if you run as normal user, then a user-specific user-owned $HOME in /data/$PUSER is used instead, as to avoid permission issues caused by different users otherwise sharing the same user home folder. That means that application data such as your license key may be stored in different places depending on the environment you pass in.
:idea: Please read the FAQ and How to Request Help.
Post Reply