cdalvaro / docker-salt-master

🐳🧂 Dockerized Salt Master - Boost your @saltstack master service with the power of @docker

Home Page:https://docs.saltproject.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additional dependencies

cdalvaro opened this issue · comments

Discussed in #233

Originally posted by abhi1693 March 7, 2024
What is the best way to install additional dependencies into the container so that it persists across reboots?

As requested by @abhi1693, it's a good enhancement for this project to add support for additional dependencies.

The main idea is to be able to install python packages when the container starts before running salt-master so modules that require extra packages can fulfill their requirements.

Two approaches can be taken:

  • Install dependencies providing a requirements.txt file
  • Specify python packages using an environment variable

Both approaches can be implemented. Since one method can be more suitable than the other depending each configuration.

I think we can use the environment variables PYTHON_PACKAGES_FILE and PYTHON_PACKAGES to specify the requirements.txt file and a list of packages, respectively.

Allowing both systems at the same time can be confusing, so the first one will take priority over the second one. So, when the env variable PYTHON_PACKAGES_FILE is defined, PYTHON_PACKAGES will be ignored.

PYTHON_PACKAGES will be directly forwarded to the pip install command. So, as long it respects pip install format, all pip functionality will be supported.

I think I would prefer requirements.txt. So, if I understand correctly, the entrypoint will read this file and invoke salt-pip install <pkg> on startup? Salt packages its own python if I'm not wrong so running salt-pip seems more preferable than pip install to me.

I think I would prefer requirements.txt. So, if I understand correctly, the entrypoint will read this file and invoke salt-pip install <pkg> on startup? Salt packages its own python if I'm not wrong so running salt-pip seems more preferable than pip install to me.

🎯 That's it! I think I'll have ready tomorrow.