Bug 41062

Summary: Support params in the "docker create" call
Product: UCS Reporter: Dirk Wiesenthal <wiesenthal>
Component: App CenterAssignee: Dirk Wiesenthal <wiesenthal>
Status: CLOSED FIXED QA Contact: Florian Best <best>
Severity: enhancement    
Priority: P1 CC: gulden, walkenhorst
Version: UCS 4.1   
Target Milestone: UCS 4.1-1-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: --- What type of bug is this?: ---
Who will be affected by this bug?: --- How will those affected feel about the bug?: ---
User Pain: Enterprise Customer affected?:
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: Bug group (optional):
Max CVSS v3 score:

Description Dirk Wiesenthal univentionstaff 2016-04-15 12:23:53 CEST
When a Docker App is installed, a docker container is created via
  docker create ...

Adapting the parameters of this call is somewhat limited.

You have influence on "-e" (env variables), "-p" (ports), "-v" (volumes).

To support --mac-address, --net and so on we should support a generic mechanism:

ucr get appcenter/apps/$app/docker/startparams=...

should be included in the docker create call. The variable can then be set by the preinst script of the corresponding App.
Comment 1 Dirk Wiesenthal univentionstaff 2016-04-25 12:22:48 CEST
Called it
  appcenter/apps/$app/docker/params
in
  univention-appcenter 5.0.20-47.160.201604251220

E.g.
  ucr set appcenter/apps/%(app_name)s/docker/params="-e FOO=bar --net=host"

They can be set in the preinst and change the docker create call.

Test: 80_docker/54_app_preinst
Comment 2 Florian Best univentionstaff 2016-04-26 08:56:40 CEST
This causes a forever hanging process if the variable is unset.

Because shlex.split(None) waits for stdin.
Comment 3 Dirk Wiesenthal univentionstaff 2016-04-26 11:03:49 CEST
Fixed in
  univention-appcenter 5.0.20-48.161.201604261100
Comment 4 Florian Best univentionstaff 2016-04-27 11:06:36 CEST
OK: the parameter does only work during docker image creation (=app installation or app upgrade).
OK: --mac-address works
Comment 5 Janek Walkenhorst univentionstaff 2016-04-27 17:32:36 CEST
<http://errata.software-univention.de/ucs/4.1/157.html>