Install additional software inside a container

ratho

Cadet
Joined
Nov 13, 2021
Messages
3
Hello,

I installed several Docker container on my TrueNAS Scale - can I install additional software with the web gui?
Under Docker I can use
Code:
RUN apt-get update && apt-get install -y \
        libfreetype6-dev \


Thanks,
ratho
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It sounds like what you want is a new docker image based on the one you're starting with, but then injecting those other packages.

Then you would run your container instead.

If you really want to edit the container (every time it's re-created, which can be often), then you could use the commands here to get to the console:
 

ratho

Cadet
Joined
Nov 13, 2021
Messages
3
In the shell I can install other software - but I like a solution that install the software at re-creation.
I'm looking in the cmd part - but can't find the correkt syntax

2021-11-13 12_51_02-Clipboard.png
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
What you (both) need to do is learn how to create a docker image using something like docker build... I'm sure some googling will turn up thousands of how-tos.


You can create your dockerfile (for use with docker build) in github and then use docker hub to build that or you can build it locally and use docker push (after tagging the image to name it) to upload it to the docker registry (or a private one of your own).

You can base your image (at the start of the dockerfile) on the one you're already using and just add the bits you want in the container.
 

eicosan

Cadet
Joined
Feb 25, 2022
Messages
4
Hi Stretalla,
I know the concept of docker containers and how to build them.
In my case I'm using the TrueCharts application of node-red and I need an additional python library to execute certain scripts.

I wanted to avoid building my complete own node-red virtualisation or docker container.

Thanks,
Johannes
 

eicosan

Cadet
Joined
Feb 25, 2022
Messages
4
sretalla, sorry for auto correction of your nick. I'm not able to edit my post.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
So you could present a host path to the container and have a script in that which carries out your install commands, then refer to that on the CMD... making sure to end that script with whatever the container normally would execute.
 

truecharts

Guru
Joined
Aug 19, 2021
Messages
788
Hi Stretalla,
I know the concept of docker containers and how to build them.
In my case I'm using the TrueCharts application of node-red and I need an additional python library to execute certain scripts.

I wanted to avoid building my complete own node-red virtualisation or docker container.

Thanks,
Johannes

If you don't even file a request for us to add said library... well... then you're up for doing it the hard way.
Which means building your own docker image, sadly enough...

But in general, regardless of SCALE or Unraid or whatever, you cannot persistently install random software into most containers unless the container creator took that into account. It's simply not what containers are for.

So in all of those cases, if you need container modification you would've to... modify the container.
or override the starting command like @sretalla explained, if that's supported on the App in question.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
file a request for us to add said library
Yes, there's also that option... seems like a good idea unless you want to be able to change it a lot without waiting on anyone else.
 

eicosan

Cadet
Joined
Feb 25, 2022
Messages
4
If you don't even file a request for us to add said library... well... then you're up for doing it the hard way.
Which means building your own docker image, sadly enough...
Hi truecharts,

Sorry, didn't know that there is a possibility to get that added. I'm using TrueChart apps since a few days.
Can you please point me to were I can request the python library (pymodbus)?

Thanks!
 
Top