Closed KingYes closed 5 years ago
Probably because there is no bash on that docker container. Many images, including these use only POSIX shell:
kubectl exec -it dockername-XXX-YYY -- /bin/sh
Hey,
Can you change the base OS you use in this docker?
I need apt-get
for example to install extra packages..
use apk add and do not forget to run apk update before. have a look for example to my dockerized piwik repo on github
On Tue, 24 Jul 2018 at 14:32, Yakir Sitbon notifications@github.com wrote:
Hey,
Can you change the base OS you use in this docker?
I need apt-get for example to install extra packages..
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/phpearth/docker-php/issues/21#issuecomment-407390084, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK0vKEo_tNdgqwtD1zf4qL-PwQn5iITks5uJxPvgaJpZM4VcJUt .
Alpine's packages: https://pkgs.alpinelinux.org/packages
To use a Debian based distribution, yes, a completely new Dockerfile is required for a base image. Otherwise, Alpine today provides most things already except software that require glibc specifically. Alpine is based on musl (the system C headers and stuff) and that causes some incompatibilities with software that is not made portable enough yet.
Okay, thanks !
But for now I can't get mysqli
ext to work. In this code:
var_dump(function_exists('mysqli_connect'));
I get false
.
My docker file is:
FROM phpearth/php:7.2-nginx
RUN apk add --no-cache php7.2-sodium php7.2-intl php7.2-pdo_mysql bash wget
What I miss?
@KingYes
the php7.2-mysqli
package...
It's the same. Can you show your own docker for that?
Maybe need to reload the nginx after this package get installed?
FROM phpearth/php:7.2-nginx
RUN apk add --no-cache php7.2-sodium php7.2-intl php7.2-pdo_mysql php7.2-mysqli bash wget
To build your customized Docker image:
docker build -t myvendor/myapp -f Dockerfile .
To run Docker container from the built image:
docker run -it --rm myvendor/myapp php -r "var_dump(function_exists('mysqli_connect'));"
I think this should work ok... But we need to bump also PHP versions in the docker hub to have the latest PHP versions...
P.S: it might be that you need to refresh your image once you've installed a new package... Common issuee with Docker sometimes...
If I run this docker by your example, I get "true". But the same docker in Kubernetes I get "false". :(
I'll check it out, thanks for reporting then... Do you maybe have any direct steps to reproduce this?
Okay, it's like a cache. I clear the cache from my images, and it's working. Thank you !
Sorry about that.
In case of issues, just ask.. Thanks.
Sorry for that, but what is the best way to install SSL on this docker?
This is my output about this:
It's in Kubernetes, but in local docker its a same.
Thanks!