Install package in Docker

I need to install packages inside a container, where HA is installed
So I did following to acces the Container command line :

sudo docker exec -t -i homeassistant /bin/bash

And then I tried following :

bash-5.0# RUN apk update
bash: RUN: command not found
bash-5.0# apt-get update
bash: apt-get: command not found
bash-5.0# RUN apt-get update
bash: RUN: command not found

Is it possible to install something inside a container ?
In fact, I need “sendip” to be runned from my container. It’s OK outside :

pi@raspberrypi:~ $ sudo apt-get install sendip
Reading package lists... Done
Building dependency tree
Reading state information... Done
sendip is already the newest version (2.5-7).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

The home assistent containers are built on buildroot/ alpine linux, not debian, so apt-get will not work. Besides, it is not a good idea to try, first time you upgrade your extra packages will be gone.

Oh, bad news. Thanks for advices.

No. You should setup needed script on host and call that from within HA.

Thanks for the interest.
You mean directly in HA, via the “Terminal” ?
For example, to switch my RGB lights on, I connect the rpi, and run this :

sudo sendip -p ipv4 -p udp -us 30978 -ud 30977 -d 0xfbeb0000000000f2668500d00 -v 192.168.1.210

But the same command in the terminal from HA does nothing.
Could you be more explicit on how to setup script on host and call them?

Sorry but I not much help here.
I know it possible but never do myself. In link below they used script integration to login host from HA and run command.

For ssh we it look like he had weird way of setup but I realize now to setup ssh from docker to host you should

  1. Generate rsa private/pub from host
  2. Install both private and pub on host (private done automatically so you just need put public key)
  3. Mount that private key file in ha docker container (- v pathtokey:/samepathindocker)
  4. Ssh should work as ha has private key and host has public key

Ok, I’ll give a try, Thanks