laradock/php-fpm

apt fails to retrieve any new packages

i3anaan opened this issue · 3 comments

This one for sure caused me a headache:
I wanted to install the php7.1 intl extension in our php-fpm container, however, instructions such as listed here were not working:
https://www.colinodell.com/blog/2016-12/installing-php-7-1

Another example failure:
sudo docker run -u 0 [php-fpm container] apt-get install nano

Whatever I tried, the container was unable to locate any package that was not already installed. The source list was fine, but after a long search, I found the culprit: ls -la /var/lib/apt/lists/ showed nothing, the folder was empty. Running apt-get update did not restore this folder, it stayed empty.

Getting back to the code in this repository, the following line seemed to cause this issue:
&& rm -rf /var/lib/apt/lists/*

Now is my experience with Debian and php-fpm limited, but this, disabling the functioning of apt, definitely does not seem like intended behaviour?

For now, our workaround will be to skip the laradock image and use the source form the dockerfile without the breaking line, but I would be very happy if this could be fixed.

It's definitely on purpose, you can rebuild this by running apt update, since you say this did not restore the functionality, please provide the entire output of running the command.

Okay,
First off: I realized I made a mistake in my reasoning previously, I have deleted those comments, I was incorrectly using docker while generating those logs: they were kind of useless after I found this out.

Secondly: I got the laradock/php-fpm container to update its packages and to install php-intl (my goal). So in that sense, this issue is most likely fixed and was caused by a user error on my side.
I will try and reproduce the incorrect result and hopefully find out what I did wrong before closing this issue.

Anyway, hope I did not waste too much of your time and thank you!

I am almost ashamed of what went wrong earlier:

  1. I tried to install php-intl using commands that were intended for Ubuntu, clearly not working for Debian
  2. I then most likely forgot to run apt-update causing me to believe apt install was broken
  3. Removing the line I blamed in this issue had no effect
  4. Misunderstanding of docker led me to further believe apt update was not working

All in all, I am happy I manage to resolve this mostly by myself, once again I hope it was mostly my own time I wasted on this, although I did learn some new stuff :)