Inside Dockerfile I have this
......
......
RUN \\
chown root:root /opt \\
&& chown wasadmin:mqm /opt/adp \\
&& chown wasadmin:mqm -R /opt/adp/pids/ \\
&& chown wasadmin:mqm -R /var/scripts/
.......
.......
Instead fo the above I want to put
......
......
COPY scripts/myscript.sh /tmp
RUN chmod 700 /tmp/myscript.sh && /tmp/myscript.sh
.......
.......
The /tmp/myscript.sh has the same contents as that of first RUN command, aka
chown root:root /opt
chown wasadmin:mqm /opt/adp
chown wasadmin:mqm -R /opt/adp/pids/
chown wasadmin:mqm -R /var/scripts/
By doing the second approach will it reduce layers ?