1

I want to wrap the existing s2i scripts given in openshift. I want to add to export two more environment variables in the run script.

I don't want to override the existing ones , i just want to extend them.

Cheers

WorriedGuy
  • 13
  • 2

1 Answers1

0

You don't need to wrap the run script. You can specify extra environment variables to be embedded in the image by adding a .s2i/environment file and adding them in there as A=B values.

You could also just set them on the deployment configuration using oc set env command.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • Thanks for the answer. I need it to run only on the run phase of the deployment and not be available during the assembling phase. – WorriedGuy Jan 30 '18 at 12:39
  • If you add it to the deployment configuration, using ``oc set env`` it will only be available when the container is run. Is there a reason you can't have it in the deployment configuration? Can you explain why not? If have reasonable reason why not, then can explain more complicated way of overriding the ``run`` script. – Graham Dumpleton Jan 30 '18 at 20:17
  • I am trying to install shibboleth in a PHP s2i image and it needs to override `libcurl.so.4`, but first, i have to download the components from composer.json and then override it. I will try the `oc set env` and will let you know. – WorriedGuy Jan 31 '18 at 08:35
  • Why do you need to override libcurl.so for that? You will not be able to replace the existing libcurl.so file as it is in a directory you can't write to. You would need to compile and install your own under a directory such as ``/opt/app-root/lib`` and then set the ``LD_LIBRARY_PATH`` environment variable to include that directory so it finds your version first. – Graham Dumpleton Jan 31 '18 at 08:46
  • Nice thanks for the help the last suggestion worked. – WorriedGuy Jan 31 '18 at 09:10