Run commands on Dockerfile are not working

I have the following Dockerfile. When I run the Dockerfile, the commands seem to execute without any issues, but when I login in to the container the file is unchanged. Any idea why this is happening? If I login into the container directly and I execute the commands they execute without any issues and update the file. The problem is building the image, the files /etc/kamailio/kamctlrc and /etc/kamailio/kamailio.cfg are unchanged.

FROM kamailio/kamailio:5.2.8-stretch

# To use MYSQL as DB 
RUN sed -i 's/# DBENGINE=MYSQL/DBENGINE=MYSQL/g' /etc/kamailio/kamctlrc 
 
# DB access
RUN sed -i 's/# DBRWUSER="kamailio"/DBRWUSER="kamailio"/g' /etc/kamailio/kamctlrc 
RUN sed -i 's/# DBRWPW="kamailiorw"/DBRWPW="kamailiorw"/g' /etc/kamailio/kamctlrc 
RUN sed -i 's/# DBROUSER="kamailioro"/DBROUSER="kamailioro"/g' /etc/kamailio/kamctlrc 
RUN sed -i 's/# DBROPW="kamailioro"/DBROPW="kamailioro"/g' /etc/kamailio/kamctlrc 

RUN sed -i 's/#CHARSET="latin1"/CHARSET="utf8"/g' /etc/kamailio/kamctlrc 
RUN sed -i 's/# DBPORT="3306"/DBPORT="3306"/g' /etc/kamailio/kamctlrc 

#SET EXTRA TABLES
RUN sed -i 's/# INSTALL_EXTRA_TABLES=ask/INSTALL_EXTRA_TABLES=yes/g' /etc/kamailio/kamctlrc 
RUN sed -i 's/# INSTALL_DBUID_TABLES=ask/INSTALL_DBUID_TABLES=yes/g' /etc/kamailio/kamctlrc 
RUN sed -i 's/# INSTALL_PRESENCE_TABLES=ask/INSTALL_PRESENCE_TABLES=yes/g' /etc/kamailio/kamctlrc 
 
# DB DOCKER HOST
RUN sed -i 's/# DBHOST=localhost/DBHOST=mariadb/g' /etc/kamailio/kamctlrc 
 
# To enable usage of MySQL 
RUN sed -i -e '1i#!define WITH_MYSQL\' /etc/kamailio/kamailio.cfg 
RUN sed -i -e '2i#!define WITH_AUTH\' /etc/kamailio/kamailio.cfg 
RUN sed -i -e '3i#!define WITH_USRLOCDB\' /etc/kamailio/kamailio.cfg 


ENTRYPOINT ["kamailio","-DD","-E"]

Hi mirjoli021 sounds like an issue with the permissions. Maybe try to change user to root before running SEDs?