Answer the question
In order to leave comments, you need to log in
Executing a command when starting a Docker container?
Something is completely off. You need to clear the laravel cache when starting the container. But the problem is that the cache cleaning script ends and the container ends with it. I tried to sculpt crutches like:
CMD ["/usr/bin/php", "/var/www/laravel/artisan", "cache:clear"]
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]
ENTRYPOINT [ "/bin/bash", "-c", "'php /var/www/laravel/artisan cache:clear'", "&&", "/usr/sbin/apache2ctl", "-D", " FOREGROUND"]
CMD ["/var/www/laravel/artisan", "cache:clear", "&&", "/bin/bash"]
Step 11/12 : CMD /usr/bin/php /var/www/laravel/artisan cache:clear
---> Running in 4c1202595b35
---> 5dff8f60522c
Removing intermediate container 4c1202595b35
Answer the question
In order to leave comments, you need to log in
Use --rm and run without cache. The container must be disposed of in the trash after use.
Well, or smut smut entry point.sh again smut and at the end --rm anyway.
CMD /bin/bash -c '/usr/bin/php /var/www/laravel/artisan cache:clear' && /usr/sbin/apache2ctl -D FOREGROUND
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question