[Solved] Question: Flag for docker instances to to temporarily disable internet connection to Maven repository at first startup

If you are mounting user data into the container then it is not correct that the container is starting anew every time. Only if the container is upgraded to a different version or you’ve cleared the cache, or you have not mounted user data and create a new container does the OH go out and install new bindings.

So the question is, does any of the above apply in your case?

In answer to the original post, no, there is no way I know of to prevent maven from teaching out on startup if it needs to install some add-ons. Anything you do network wise outside of Docker is just going to be there same as the problem you experienced. OH won’t new able to reach maven and give you the same error.

So first I recommend considering if this is a problem worth fixing. In be all the years I’ve used ooenHAB this is the first time a pregnant like this has happened.

If so, consider creating a custom image with the add-ons installed like Bruce suggested. Then OH won’t reach out to install the add-ons and can install them from the local set.

Make sure to mount usersdata into the container. Refrain from manually clearing the cache. If changing to a new container fails, look in usersdata/backup. Every time the container changes versions, the entry point script creates a full backup of everything before clearing the cache so that the add-ons for the new version can be downloaded and installed. So if the upgrade fails, revert back to the old image, restore the backup, then start the container using the old version image. As long as the version in usersdata/etc/versions.properties matches the version of OH nthe image, usersdata is left unmodified and oh won’t try to install add-ons at startup.

1 Like