We installed DX v9.5 container images on OpenShift and got it up and running. The container image seems is based on RHEL v8.2 and is (what makes imho perfectly sense) a minimum image.
However for PD reasons etc. we'd sometimes like to have additional RPMs (like for example net-tools etc.) installed. However there's not yum and/or dnf installed but we have micodnf available (which makes me believe that the image is based un a UBI image). When tryin to use microdnf however we are running into permission issues:
sh-4.4$ microdnf install net-tools
(microdnf:6690): libdnf-WARNING **: 10:53:53.277: Loading “/etc/dnf/dnf.conf”: IniParser: Can’t open file
error: failed to obtain lock ‘metadata’: Failed to create file ?/var/cache/yum/lock/dnf-metadata.lock.R3I5U0?: Permission denied
Using `sudo` does not work either:
sh-4.4$ sudo microdnf install net-tools
sh: sudo: command not found
Is there a way to get additional packages installed or do we have to find an alternate way to get more software installed?
Thanks in advance for your advise - Hermann
Hi Hermann,
In order to install additional software on any docker container image, you need to create a new image using the docker build command:
https://docs.docker.com/engine/reference/commandline/build/
However, HCL does not support customizing our DX images so using this command and creating your own DX images would put you in an unsupported state.
Thanks,
Oscar
Hermann,
That's a great question and one that we in development grappled with several months ago. The short version is "you can't"! Which is sad. OpenShift does NOT allow root access and we haven't included "sudo" because there are security exposure risks with "sudo". I don't know if you noticed yet, but "dnf" is not there either; rather we use "microdnf" at DockerFile time to install any packages we want.
Your question is exactly one that the development team asked many months ago. The short version of the answer is that we have a "development" (we actually call it "debug") version of the Docker image that we use for debugging for exactly the reason you are asking about. It has "sudo" and the net tools. Since you are "HCL", you might have access to it. Ask Ralf.
For general customers though, it's an OpenShift thing to NOT have root.
As was suggested below, perhaps you can clone the Docker image, add "sudo" and any other packages you want and deploy that in OpenShift or Kubernetes (or even plain Docker). That would likely solve the issue you are asking about.
Hey Alex,
thanks a lot for your response.
The issue with the cloned docker image is as @Oscar Hernandez mentioned above that this is then not supported anymore. And it is quite often that there are environmental specific issues resulting in situations were these tools would be helpful (different firewall settings in different environents etc.).
But yes, we might have to consider creating our own debug image if needed as this seems to be the only option here (as I'm not "HCL" :) ).
Thanks again ...