onstartup.adoc 893 B

1234567891011121314151617181920212223242526272829303132
  1. [#exec-startup]
  2. = Execute on startup
  3. OliveTin can execute actions on a startup.
  4. [source,yaml]
  5. .`config.yaml`
  6. ----
  7. actions:
  8. - title: Say hello
  9. shell: echo "Hello!"
  10. execOnStartup: true
  11. ----
  12. [#dnf-startup]
  13. == Example: Install additional commands into OliveTin
  14. This functionality to execute actions on startup is a very easy way to install additional commands in OliveTin, however it requires running OliveTin as a root user to be able to use `microdnf`;
  15. [source,yaml]
  16. .`config.yaml`
  17. ----
  18. actions:
  19. - title: Install dnsmasq
  20. shell: microdnf install bind-utils
  21. execOnStartup: true
  22. ----
  23. A more secure method than running DNF as root, is a manual command the temporarily runs as root. To learn more about how to install additional packages into the container in this more secure way, see xref:reference/containerInstallPackages.adoc[Installing extra container packages].