Dockerfile – removing a file in one RUN command, it is still present in the next RUN command

I had a similar issue:

   RUN rm -rf /full/path
   RUN ln -s /other /full/path

This fails because “/full/path” still exists on the second RUN. This workaround works:

   RUN rm -rf /full/path; ln -s /other /full/path

I don’t understand the behavior but was able to work around it in my case.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)