Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating packages at first run leads to startup failures in air gapped environment #255

Closed
mFranz82 opened this issue Apr 4, 2022 · 3 comments
Labels
enhancement It's not a bug, but it's worth an enhancement.

Comments

@mFranz82
Copy link

mFranz82 commented Apr 4, 2022

The image creates the file /opt/.firstrun during build. Later on when starting the image the corresponding start script triggers the package update.
I think that this behaviour is not expected when working with containers as per default a container is stateless unless you mount some volumes. If the user wants the latest packages to be installed then he should request a new image build.
When working in air gapped environments the situation is even worse. IOBroker won't start when the container get's killed and restarted.
What do you thing about this? Are there any reasons for this feature that I haven't considered?
My idea is to workaround this with a custom startup script which removes the /opt/.firstrun file.

@buanet
Copy link
Owner

buanet commented Apr 5, 2022

Hi,
as iobroker is not designed to run inside a container and most users are no developers or IT experts I had to do some concessions when building the ioBroker Docker Image. :)

I'm absolutely with you when you say

I think that this behaviour is not expected when working with containers as per default a container is stateless unless you mount some volumes. If the user wants the latest packages to be installed then he should request a new image build.

but unfortunately this is not the (ioBroker) reality.

The idea of implementing the auto package update at the very first start of a new container is, that I wanted to make sure the container launches with the newest versions of depending linux packages included in the ioBroker Docker image.
Of course, I could rebuild the image every night from source, but I wanted to keep the number of builds small. This is why I decided to only rebuild the image when I release a new image version or iobroker releases a new js-controller version.

Back to your issue, I will do some tests to figure out where the problems are when ioBroker is running without a internet connection. I always thought it will simply skip the package updates when there is no internet connection available.
Maybe there is a possibility to implement some kind of offline mode for the container to make sure the container starts without any errors when there is no internet available.

My idea is to workaround this with a custom startup script which removes the /opt/.firstrun file.

If you mean the implemented startup scripts this will not work as the scripts are called within the last step of the startup script. This will be way to late.
At the moment the only way to remove the file will be to remove it from the Dockerfile and build your own image.

Regards,
André

@mFranz82
Copy link
Author

Hey @buanet !
Thanks for your replay and for the hint according to the startup scripts.

I like upstream projects like yours and so I try to avoid building own images. Maybe you will a prober solution somedays. Actually it is not that important to me.

Anyway, thanks for sharing this image!

Regards, Martin

@buanet buanet added the enhancement It's not a bug, but it's worth an enhancement. label Apr 18, 2022
@buanet
Copy link
Owner

buanet commented Jun 21, 2022

I added a ENV OFFLINE_MODE in v7.0.0. Setting it to true will make the container start without the need of an internet connection.

Regards,
André

@buanet buanet closed this as completed Jun 21, 2022
agross added a commit to agross/ansible-home-network that referenced this issue Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement It's not a bug, but it's worth an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants