Httpd image - need to run siteminder webagent script first

Hi,
I am trying to use httpd image.
So here with this image need to use siteminder webagent.
Since siteminder webagent require to run create a file before apache start - I tried using docker exec.
But since apache always restarting whenever I stop it, it is not possible.

Any clue how to proceed?

Maybe create your own image from the one you’re using and add/create the file?
Then the file will be there when you start the container

Sorry I am not expert in creating this image.
Please can let me know if any example.

This is from my docker compose now.

FROM httpd:2.4.35

RUN { \

echo ‘IncludeOptional conf.d/*.conf’; \

} >> /usr/local/apache2/conf/httpd.conf \

&& mkdir /usr/local/apache2/conf.d

#version and dist path passed in via --build-arg

ARG OUT_FOLDER

ARG HTDOC_FOLDER

COPY ./dist/${OUT_FOLDER}/ /usr/local/apache2/htdocs/${HTDOC_FOLDER}

Your RUN command is wrong:

use this instead

RUN echo "IncludeOptional conf.d/*.conf;" >> /usr/local/apache2/conf/httpd.conf

Sorry, the should be like as below

“run this 1st script”
“Then use this httpd image”.

So the minute httpd with “run” it is trying to start apache.