Issue of the topic: i can not make open run on podman. I triede many option.
I am a beginner and i made home assistant run easy but openhab doesnt work.
It keeps restarting.
I just want a simple podman run code to get openhab running and figure out someday later how other stuff with podman works.
This is my code in podman but keeps at saying lauching openhab. With different command lines.
Home assistant required this code and podman works
openhab_1_abc1cdae37c5 | Launching the openHAB runtime...
and it works perfectly well (openhab:3.3.0, but with docker not podman)âŠ
so probably it is actually running? If you just canât open the web page, this might be due to port which is 8080 as default as far as I understand, not 8050.
:Z
Why do i need to put :Z on the end of the directory
After this the permission to write went away
âprivileged
Why is it used and why would it be useful?
-d
What does detach mean and why would jou want it? Detach didnt show log but after running podman run openhab container log it show permission denied. Why?
ânet=host --network=host
Does not give any port to my container. Dont understand why.
âcap-add=CAP_NET_RAW,CAP_NET_BIND_nSERVICE â
I cant make up this command that i copy and paste from the home assistant command
restart=unless-stopped
That what it did with last code when it didnât get further then starting the container. It kept restarting.
Some command line use --init
Not sure why but i do see it sometimes.
-p 8050:8050
This is just some port I thought was handy because some application requires 8080 port.
So I thought changing the port it schould not be to busy. Or to have control over the ports.
I that correct or does the openhab image just only work with 8080 port? Because after changing back to 8080 m:8080 it worked!!â
I am trying to figure out how to make the container connect to the internet. I found some info but I started containers 1 week agođ .
-p 8080:80 for example how does improve the situation. Is it that for getting network acces it isnât possibly by command run?
Also for the error I am thinking was this ~before the folders. What is it exactly? After trying out from the homeasistant command line, now it does write and build the container.
After running the openhab demo.
Some documents where place in some folder but now it says i canât remove because i do jot have priffiliged to remove the folders. Not sure how to remove the privileges.
Ultimately these are all question you can and should get from the Docker and Podman docs. They are not related to OH at all. If you choose to use a non-supported configuration and way to run OH, itâs up to you to know and understand what you are doing or seek help on a forum for Docker and Podman. You could start with docker run | Docker Docs.
Whether or not you want to take the time to learn Podman and Docker is, frankly, not our problem. We here are openHAB experts, not Docker or Podman experts. We have nearly a dozen supported and documented ways to install and configure OH. Podman is not one of them, but Podman does generally follow Docker. See Docker | openHAB for the docs showing how to run in Docker and see what might translate.
At a high levelâŠ
Thatâs the command to Docker to mount the given folder on the host machine into the container at the given location.
It tells Docker that the volume is exclusive to that container and not shared to another container.
Tells the container to run as root. Usually you do not want to do that. But the fact that the error went away really points at your host not having a UID 9001 and/or the volumes mounted to the container do not have permissions that allow it to read/write/modify those directories.
Runs the container in the background.
When you want the program to continue running even after you log out.
Because itâs running in the background. You have to use the docker logs command to see itâs logs.
Because openHAB is failing to start in the first place.
It adds the CAP_NET_RAW and CAP_NET_BIND_nSERVICE to the container. What does that mean? None of us here are Docker nor Podman experts. But the Docker docs like have stuff to say about it.
What makes you think that would work in the first place? openHAB is a completely different program with completely different needs and expectations. Would you expect to be able to copy a command youâd run on a Mac and have it work on Windows? Same thing. You need to use the command and arguments as outlined in the openHAB docs.
Because it kept failing to start.
Docker docs should explain that.
You canât just choose a random port. The first number is the port to expose to the world and the second number is the port used by container. You canât just randomly choose the second number and the -p option is pointless when using --net=host.
Please review the docs for Docker. You are spending a lot of your own time as well as using the time of everyone here struggling with things that are not even openHAB related and which have answers in the Docker docs, Podman docs, and numerous publicly available tutorials online.
Weâve already explained several times and from several users on this thread. Once again.
Linux implemented discretionary access controls. This means the owner of a file (or root) grants which other users have access to read, write, and execute files.
openHAB runs inside the container as user 9001 with a group 9001 (unless otherwise told to run as something else, see the docs).
When the container starts, all the ownership and permissions of the mounted volumes are changed to be owned by 9001:9001 and only user 9001 has permission to write to the files.
If you donât have a 9001 user on your host, you donât have any user on the host except root that can write to those files.
Thatâs super basic Linux. If you struggle with basic Linux, please go through some basic Linux tutorials. If you donât know basic Linux you are unlikely to ever be successful using Docker or Podman. You might eventually stumble into something that works but it will be brittle. At some point something weird will happen and youâll be loss to fix it.
I highly recommend instead of trying to run OH in Docker on Podman, that you get started running OH on a more familiar operating system, or, as the docs recommend, use openHABian on an RPi which handles all this stuff for you and all you need to worry about, at least at first, is openHAB itself.
From an openHAB context, this argument is nonsense. There is nothing inside the container using port 80. As the docs recommend use --net=host instead.
Thanks for youâre reply and everybody else!
I wil try these options everybody said and see if I can make it happen:)
I wil indeed look for a more suited environment for my podman (docker) commands questions.
Why is mine way of using openhab not supported if i may ask?
Openhab container?
I did not find any podman forum to ask these questions so I just dropped some questions at some forums to get some help and only here there were helpful. From my understanding podman and Docker work the same but also they are not the sameđ€Ș some commands are the same and some not.
There was a kind of hurry because I promised my wife that it would work fast again:) I have used jung sv server for a while for knx but it is just not reliable to use. Connection tru a server in germany takes evertime to long or on android it doesnât connect and we have to reapply the password again for the user because we removed the cashe. Knx and tasmota knx works perfect but now i want to move to knx and mqtt for more reliability. So then I started a server with home assistant and openhab to replace the jung server:)
Thanks again for youre detailed explanation!!
And apologies for my topic that is not related to openhab fully. Thanks for the support! I will try these options tonight when i get back from holidayâ:sunglasses:
There is a slight difference between ânot supportedâ as in it wonât work and âwe donât support itâ meaning itâs a way to run OH that is relatively uncommon so we canât do much to help. Running the OH container in Podman is the latter.
from your first comment it seems your host folders are not in /opt/openhab but in ~/opt/openhab thus you may want to adjust this?
What also may help:
Create user openhab:openhab as 9001:9001 on the host system
Switch ownership of the openhab folders to this new user / group (it helps if your normal user is also assigned to group openhab / 9001 such that you can easily access the files)
remove existing container (docker rm ) to start freshly
if you do not have relevant content in your openhab folders, I would also clean these up
Then start new instance of the container and see what happens