Hi,
inspired by Docker app - Permission denied / no write access to mapped volume I was thinking if I could give users the possibility to specify an alternative mountpoint for the Minio app. According to https://wiki.univention.de/index.php/Docker_Apps/Image_Based#Life_cycle the preinst script is the only place where I can still influence the docker image before it actually is started for the first time.
But it seems the data from the settings screen is only processed once preinst is already run:
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: Changed: set(['minio'])
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: Local hosts are: ['ucs-1968.kopano.intranet', '192.168.50.10']
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: Processing cn=minio,cn=portal,cn=univention,dc=kopano,dc=intranet
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: Attrs: {}
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: Links: []
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: Existing links: ['https://ucs-1968.kopano.intranet:8456/']
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: New links: []
15992 portalentries 18-05-23 15:52:40 [ DEBUG]: Removing DN
15992 attributes 18-05-23 15:52:40 [ DEBUG]: Adding bluespiceActivated to list of attributes
15992 attributes 18-05-23 15:52:40 [ DEBUG]: Removing DN: cn=bluespiceActivated,cn=bluespice,cn=custom attributes,cn=univention,dc=kopano,dc=intranet
15992 attributes 18-05-23 15:52:40 [ DEBUG]: Adding digitec-bisActivated to list of attributes
15992 attributes 18-05-23 15:52:40 [ DEBUG]: Removing DN: cn=digitec-bisActivated,cn=digitec-bis,cn=custom attributes,cn=univention,dc=kopano,dc=intranet
15992 actions.register 18-05-23 15:52:40 [ INFO]: Registering schema /usr/share/univention-appcenter/apps/mattermost/mattermost.schema
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Adding openprojectActivated to list of attributes
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Adding openproject-isadmin to list of attributes
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Adding openproject-user to list of classes
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Removing DN: cn=openprojectActivated,cn=openproject,cn=custom attributes,cn=univention,dc=kopano,dc=intranet
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Removing DN: cn=openproject-isadmin,cn=openproject,cn=custom attributes,cn=univention,dc=kopano,dc=intranet
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Adding relutionActivated to list of attributes
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Removing DN: cn=relutionActivated,cn=relution,cn=custom attributes,cn=univention,dc=kopano,dc=intranet
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Adding webweaverActivated to list of attributes
15992 attributes 18-05-23 15:52:42 [ DEBUG]: Removing DN: cn=webweaverActivated,cn=webweaver,cn=custom attributes,cn=univention,dc=kopano,dc=intranet
15992 actions.register.progress 18-05-23 15:52:43 [ DEBUG]: 100
15992 settings 18-05-23 15:52:46 [ INFO]: Cannot read MINIO_ACCESS_KEY while 4.2/minio=RELEASE.2018-05-16T23-35-33Z is not running
15992 settings 18-05-23 15:52:46 [ INFO]: Cannot use None for MINIO_ACCESS_KEY
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for MINIO_ACCESS_KEY
15992 settings 18-05-23 15:52:46 [ INFO]: Cannot read MINIO_SECRET_KEY while 4.2/minio=RELEASE.2018-05-16T23-35-33Z is not running
15992 settings 18-05-23 15:52:46 [ INFO]: Cannot use None for MINIO_SECRET_KEY
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for MINIO_SECRET_KEY
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for minio/path
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for minio/hostname
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for minio/sslcertificate
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for minio/sslkey
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for minio/sslca
15992 settings 18-05-23 15:52:46 [ INFO]: Falling back to initial value for minio/sslchain
The above seems to be from the time the settings screen pops up for the admin/user.
15992 actions.install 18-05-23 15:53:14 [ DEBUG]: Calling install
15992 actions.install.progress 18-05-23 15:53:14 [ DEBUG]: 0
15992 actions.install 18-05-23 15:53:14 [ INFO]: Going to install Minio Multi-Cloud Object Storage (RELEASE.2018-05-16T23-35-33Z)
15992 actions.install 18-05-23 15:53:15 [ DEBUG]: Calling prescript (preinst)
15992 actions.install 18-05-23 15:53:15 [ DEBUG]: Calling /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/minio_20180523152915.preinst --locale en --binddn uid=Administrator,cn=users,dc=kopano,dc=intranet --bindpwdfile /tmp/tmp9PVepS --version RELEASE.2018-05-16T23-35-33Z --error-file /tmp/tmpdqgV_S
15992 actions.install 18-05-23 15:53:15 [ INFO]: no path was specified exiting setup
The message no path was specified exiting setup
comes from my preinst script and indicates that minio/path
is not set/has an empty value.
15992 actions.install 18-05-23 15:53:15 [ DEBUG]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/minio_20180523152915.preinst returned with 0
15992 packages 18-05-23 15:53:15 [ DEBUG]: Holding LOCK
15992 actions.install 18-05-23 15:53:15 [ INFO]: Creating data directories for minio...
15992 actions.install.progress 18-05-23 15:53:15 [ DEBUG]: 5
15992 actions.install 18-05-23 15:53:15 [ INFO]: Registering UCR for minio
15992 actions.install 18-05-23 15:53:15 [ INFO]: Marking 4.2/minio=RELEASE.2018-05-16T23-35-33Z as installed
15992 actions.install 18-05-23 15:53:20 [ INFO]: Creating /etc/init.d/docker-app-minio
15992 actions.install 18-05-23 15:53:20 [ DEBUG]: Calling /usr/sbin/update-rc.d docker-app-minio defaults 41 14
15992 actions.install 18-05-23 15:53:20 [ DEBUG]: /usr/sbin/update-rc.d returned with 0
15992 actions.install 18-05-23 15:53:20 [ DEBUG]: Calling /bin/systemctl daemon-reload
15992 actions.install 18-05-23 15:53:21 [ DEBUG]: /bin/systemctl returned with 0
15992 actions.install 18-05-23 15:53:21 [ INFO]: Adding localhost to LDAP object
15992 actions.install 18-05-23 15:53:21 [ INFO]: Setting overview variables
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Changed: set(['minio'])
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Local hosts are: ['ucs-1968.kopano.intranet', '192.168.50.10']
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/label' -> 'Minio'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/link' -> '/minio'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/port_http' -> '80'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/description' -> 'Minio is an Amazon S3 compatible object storage server'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/icon' -> '/univention/js/dijit/themes/umc/icons/scalable/apps-minio_20180523152915.svg'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/label/de' -> 'Minio'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/description/de' -> 'Minio is an Amazon S3 compatible object storage server'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Matched 'ucs/web/overview/entries/service/minio/port_https' -> '443'
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Processing cn=minio,cn=portal,cn=univention,dc=kopano,dc=intranet
...
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: Links: ['http://192.168.50.10/minio', 'https://192.168.50.10/minio', 'https://ucs-1968.kopano.intranet/minio', 'http://ucs-1968.kopano.intranet/minio']
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: DN not found...
15992 portalentries 18-05-23 15:53:21 [ DEBUG]: ... creating
15992 actions.install 18-05-23 15:53:21 [ DEBUG]: Calling /etc/init.d/apache2 reload
15992 actions.install 18-05-23 15:53:22 [ INFO]: Reloading apache2 configuration (via systemctl): apache2.service.
15992 actions.install 18-05-23 15:53:22 [ DEBUG]: /etc/init.d/apache2 returned with 0
15992 actions.install.progress 18-05-23 15:53:22 [ DEBUG]: 10
15992 actions.install.progress 18-05-23 15:53:22 [ DEBUG]: 15
15992 actions.install.progress 18-05-23 15:53:22 [ DEBUG]: 25
15992 actions.install 18-05-23 15:53:23 [ INFO]: Registering the container host minio-36030232 for minio
15992 actions.install.progress 18-05-23 15:53:24 [ DEBUG]: 30
15992 actions.install 18-05-23 15:53:24 [ INFO]: Verifying Docker registry manifest for app image minio/minio:RELEASE.2018-05-16T23-35-33Z
15992 actions.install 18-05-23 15:53:24 [ INFO]: Downloading app image minio/minio:RELEASE.2018-05-16T23-35-33Z
15992 docker 18-05-23 15:53:24 [ WARNING]: Could not login to minio. You may not be able to pull the image from the repository!
^[[5~^[[5~^[[5~ 15992 actions.install 18-05-23 15:53:25 [ INFO]: Initializing app image
15992 actions.install 18-05-23 15:53:26 [ INFO]: Preconfiguring container f7abcc0b2f6bc95a8ac810ec5036561b11efcdc521b7b17ac8ad4aa27de5427d
15992 actions.start 18-05-23 15:53:26 [ DEBUG]: Calling start
15992 actions.start.progress 18-05-23 15:53:26 [ DEBUG]: 0
15992 actions.start 18-05-23 15:53:26 [ DEBUG]: Calling /etc/init.d/docker-app-minio start
16495 cache 18-05-23 15:53:27 [ DEBUG]: Cache outdated. Need to rebuild
16495 cache 18-05-23 15:53:27 [ DEBUG]: Loaded 71 apps from cache
16495 cache 18-05-23 15:53:27 [ DEBUG]: Cache outdated. Need to rebuild
16495 cache 18-05-23 15:53:27 [ DEBUG]: Unable to get mtime for cache: [Errno 2] Bestand of map bestaat niet: '/var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/.apps.nl.json'
16495 cache 18-05-23 15:53:27 [ DEBUG]: Cannot load cache: mtimes of cache files do not match: None < 1527083545.73601
16495 ini 18-05-23 15:53:27 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20171114154947.settings: Missing description in domain
16495 ini 18-05-23 15:53:27 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20171114154947.settings: Missing description in username
16495 ini 18-05-23 15:53:27 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20171017221609.settings: Missing description in domain
16495 ini 18-05-23 15:53:27 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20171017221609.settings: Missing description in username
16495 ini 18-05-23 15:53:27 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20180301215520.settings: Missing description in domain
16495 ini 18-05-23 15:53:27 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20180301215520.settings: Missing description in username
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20170904150649.settings: Missing description in domain
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20170904150649.settings: Missing description in username
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20171220164332.settings: Missing description in domain
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20171220164332.settings: Missing description in username
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora-online_20180207095517.settings: Missing description in domain
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora-online_20180207095517.settings: Missing description in username
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora-online_20171103110329.settings: Missing description in domain
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora-online_20171103110329.settings: Missing description in username
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20180205215802.settings: Missing description in domain
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20180205215802.settings: Missing description in username
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora-online_20180315100255.settings: Missing description in domain
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora-online_20180315100255.settings: Missing description in username
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20170622134722.settings: Missing description in domain
16495 ini 18-05-23 15:53:28 [ WARNING]: /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/collabora_20170622134722.settings: Missing description in username
16495 cache 18-05-23 15:53:28 [ DEBUG]: Saved 221 apps into cache
16495 cache 18-05-23 15:53:28 [ DEBUG]: Cache outdated. Need to rebuild
16495 cache 18-05-23 15:53:29 [ DEBUG]: Loaded 424 apps from cache
16495 actions.get 18-05-23 15:53:29 [ DEBUG]: Calling get
16495 actions.get.progress 18-05-23 15:53:29 [ DEBUG]: 0
16495 actions.get 18-05-23 15:53:29 [ INFO]: appcenter/apps/minio/container
16495 actions.get.progress 18-05-23 15:53:29 [ DEBUG]: 100
16598 cache 18-05-23 15:53:31 [ DEBUG]: Cache outdated. Need to rebuild
16598 cache 18-05-23 15:53:31 [ DEBUG]: Loaded 71 apps from cache
16598 cache 18-05-23 15:53:31 [ DEBUG]: Cache outdated. Need to rebuild
16598 cache 18-05-23 15:53:31 [ DEBUG]: Loaded 221 apps from cache
16598 cache 18-05-23 15:53:31 [ DEBUG]: Cache outdated. Need to rebuild
16598 cache 18-05-23 15:53:31 [ DEBUG]: Loaded 424 apps from cache
16598 actions.get 18-05-23 15:53:31 [ DEBUG]: Calling get
16598 actions.get.progress 18-05-23 15:53:31 [ DEBUG]: 0
16598 actions.get 18-05-23 15:53:31 [ INFO]: appcenter/apps/minio/ip
16598 actions.get.progress 18-05-23 15:53:31 [ DEBUG]: 100
15992 actions.start 18-05-23 15:53:32 [ INFO]: Starting docker-app-minio (via systemctl): docker-app-minio.service.
15992 actions.start 18-05-23 15:53:32 [ DEBUG]: /etc/init.d/docker-app-minio returned with 0
15992 actions.start.progress 18-05-23 15:53:32 [ DEBUG]: 100
15992 actions.install 18-05-23 15:53:35 [ INFO]: Calling ['docker', 'cp', '/etc/timezone', 'f7abcc0b2f6bc95a8ac810ec5036561b11efcdc521b7b17ac8ad4aa27de5427d:/etc/timezone']
15992 actions.install 18-05-23 15:53:35 [ INFO]: Calling ['docker', 'cp', '/etc/localtime', 'f7abcc0b2f6bc95a8ac810ec5036561b11efcdc521b7b17ac8ad4aa27de5427d:/etc/localtime']
15992 actions.configure 18-05-23 15:53:35 [ DEBUG]: Calling configure
15992 actions.configure.progress 18-05-23 15:53:35 [ DEBUG]: 0
15992 actions.configure 18-05-23 15:53:35 [ INFO]: Configuring 4.2/minio=RELEASE.2018-05-16T23-35-33Z
15992 settings 18-05-23 15:53:35 [ INFO]: Setting MINIO_SECRET_KEY to 'secretkey'
15992 settings 18-05-23 15:53:35 [ INFO]: Unsetting minio/sslchain
15992 settings 18-05-23 15:53:35 [ INFO]: Unsetting minio/sslkey
15992 settings 18-05-23 15:53:35 [ INFO]: Unsetting minio/sslca
15992 settings 18-05-23 15:53:35 [ INFO]: Setting minio/path to '/opt/test'
Only here are the settings from the settings screen actually stored in the given ucr variable.
15992 settings 18-05-23 15:53:35 [ INFO]: Unsetting minio/hostname
15992 settings 18-05-23 15:53:35 [ INFO]: Unsetting minio/sslcertificate
15992 settings 18-05-23 15:53:35 [ INFO]: Setting MINIO_ACCESS_KEY to 'admin'
15992 actions.configure.container.f7ab 18-05-23 15:53:35 [ DEBUG]: Using container.f7ab for container f7abcc0b2f6bc95a8ac810ec5036561b11efcdc521b7b17ac8ad4aa27de5427d
15992 actions.configure.container.f7ab 18-05-23 15:53:36 [ DEBUG]: Calling docker exec f7abcc0b2f6bc95a8ac810ec5036561b11efcdc521b7b17ac8ad4aa27de5427d which ucr
15992 actions.configure 18-05-23 15:53:36 [ WARNING]: ucr cannot be found, falling back to changing the database file directly
15992 actions.configure.progress 18-05-23 15:53:36 [ DEBUG]: 100
15992 actions.install.progress 18-05-23 15:53:36 [ DEBUG]: 50
15992 actions.install 18-05-23 15:53:36 [ INFO]: Executing interface restore_data_before_setup for minio
15992 actions.install 18-05-23 15:53:36 [ INFO]: No interface defined
15992 actions.install 18-05-23 15:53:36 [ INFO]: Executing interface restore_data_after_setup for minio
15992 actions.install 18-05-23 15:53:36 [ INFO]: No interface defined
15992 actions.configure 18-05-23 15:53:36 [ DEBUG]: Calling configure
15992 actions.configure.progress 18-05-23 15:53:36 [ DEBUG]: 0
15992 actions.configure 18-05-23 15:53:36 [ INFO]: Configuring 4.2/minio=RELEASE.2018-05-16T23-35-33Z
15992 settings 18-05-23 15:53:36 [ INFO]: Setting minio/path to '/opt/test'
15992 settings 18-05-23 15:53:36 [ INFO]: Unsetting minio/hostname
15992 settings 18-05-23 15:53:36 [ INFO]: Setting MINIO_SECRET_KEY to 'secretkey'
15992 settings 18-05-23 15:53:36 [ INFO]: Unsetting minio/sslcertificate
15992 settings 18-05-23 15:53:36 [ INFO]: Unsetting minio/sslchain
15992 settings 18-05-23 15:53:36 [ INFO]: Unsetting minio/sslca
15992 settings 18-05-23 15:53:36 [ INFO]: Setting MINIO_ACCESS_KEY to 'admin'
15992 settings 18-05-23 15:53:36 [ INFO]: Unsetting minio/sslkey
15992 actions.configure.container.f7ab 18-05-23 15:53:36 [ DEBUG]: Using container.f7ab for container f7abcc0b2f6bc95a8ac810ec5036561b11efcdc521b7b17ac8ad4aa27de5427d
15992 actions.configure.container.f7ab 18-05-23 15:53:36 [ DEBUG]: Calling docker exec f7abcc0b2f6bc95a8ac810ec5036561b11efcdc521b7b17ac8ad4aa27de5427d which ucr
15992 actions.configure 18-05-23 15:53:36 [ WARNING]: ucr cannot be found, falling back to changing the database file directly
15992 actions.configure 18-05-23 15:53:36 [ DEBUG]: Calling /var/cache/univention-appcenter/appcenter-test.software-univention.de/4.2/minio_20180523152915.configure_host install --locale en --version RELEASE.2018-05-16T23-35-33Z --error-file /tmp/tmppiKzYo
And sure enough, If I execute the preinst script manually after the setup has completed it actually gives the expected result (in the above case failing, since the directory does not exist).
Do you see another way to implement this functionality? I’m sure such a setting would be a nice to have for other store intensive docker apps (such as nextcloud or owncloud).
edit: the obvious may would be of course to let the admin write the differing mount path somewhere before the installation.