Obrigado a todos. Eu o assunto está no delimitador. Eu mudo "/" para ser ":" e trabalhe. Eu posto o resultado aqui. Na "Etapa 65/78", imprimo o conteúdo do script e "Etapa 67/78" executa bem o script. Obrigado @xenoid e @Kusalananda.
Step 63/78 : RUN echo "#!/bin/sh -x\nsed -i 's:PRIVATEIP:'"$(cat /home/ip_variable)"':g' /etc/fail2ban/jail.local\nsed -i 's:PRIVATEIP:'"$(cat /home/ip_variable)"':g' /etc/opendkim/TrustedHosts" > /home/ip_change_script.sh
---> Running in 251d6741c37e
Removing intermediate container 251d6741c37e
---> 95c4aa62d74a
Step 64/78 : RUN cat /home/ip_variable
---> Running in 8825ef517fb8
172.17.0.2/16
Removing intermediate container 8825ef517fb8
---> 39672eb7021d
Step 65/78 : RUN cat /home/ip_change_script.sh
---> Running in 2161051ee4cf
#!/bin/sh -x
sed -i 's:PRIVATEIP:'172.17.0.2/16':g' /etc/fail2ban/jail.local
sed -i 's:PRIVATEIP:'172.17.0.2/16':g' /etc/opendkim/TrustedHosts
Removing intermediate container 2161051ee4cf
---> 407ccc7106f7
Step 66/78 : RUN chmod 755 /home/ip_change_script.sh
---> Running in 0f6ca7f78ba8
Removing intermediate container 0f6ca7f78ba8
---> 250afb327db0
Step 67/78 : RUN sh /home/ip_change_script.sh
---> Running in 4b209e18854b
Removing intermediate container 4b209e18854b
---> d45d024e1359
Step 68/78 : RUN touch /home/service_boot.log
---> Running in 3548dc45f466
Removing intermediate container 3548dc45f466
---> 587527e18ab2
Step 69/78 : RUN cat /home/service_boot.log
---> Running in b068b00cd584
Removing intermediate container b068b00cd584
---> 3183e6b281ed
Step 70/78 : COPY boot_service.sh /home/boot_service.sh
---> 9a73dd4fd87d
Step 71/78 : RUN chmod 755 /home/boot_service.sh
---> Running in 2f226574e28d
Removing intermediate container 2f226574e28d
---> 8a0c14218e1b
Step 72/78 : RUN cat /home/boot_service.sh
---> Running in 5fa64827b6dd