I'm trying to reduce the size of my docker image. In my docker file, I do this:
FROM crystal/centos
MAINTAINER crystal
ADD ./rpms/test.rpm ./rpms/
RUN yum -y --nogpgcheck localinstall /rpms/test.rpm
from what I understand, the ADD command is in its own layer, and then RUN is in another layer. So after I install the rpm, how do I go about deleting the initial /rpms
directory.
use this technique
RUN curl http://someaddress/test.rpm &&\
yum -y --nogpgcheck localinstall /rpms/test.rpm &&\
rm test.rpm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With