Hello,
the Dockerfile has 6 COPY instructions, each of them creates a dedicated filesystem layer within the image, and best practice is to minimize the layer count.
I suggest to squeeze them into a single one by simply reorganizing files in the context:
COPY /configs/supervisord.conf /etc/supervisord.conf
COPY /configs/rsyslog*.conf /etc/
COPY /configs/opendkim.conf /etc/opendkim/opendkim.conf
COPY /configs/smtp_header_checks /etc/postfix/smtp_header_checks
COPY /configs/master.cf /etc/postfix/master.cf
COPY /scripts/* /scripts/
mkdir -p image_root/{etc,opendkim,postfix}
mv configs/supervisord.conf image_root/etc/
mv configs/rsyslog*.conf image_root/etc/
mv configs/opendkim.conf image_root/opendkim/
mv configs/smtp_header_checks image_root/postfix/
mv configs/master.cf image_root/postfix/
mv scripts image_root/
Hope it helps ☺️
Hello,
the
Dockerfilehas 6COPYinstructions, each of them creates a dedicated filesystem layer within the image, and best practice is to minimize the layer count.I suggest to squeeze them into a single one by simply reorganizing files in the context:
mkdir -p image_root/{etc,opendkim,postfix} mv configs/supervisord.conf image_root/etc/ mv configs/rsyslog*.conf image_root/etc/ mv configs/opendkim.conf image_root/opendkim/ mv configs/smtp_header_checks image_root/postfix/ mv configs/master.cf image_root/postfix/ mv scripts image_root/Hope it helps☺️